win32: Add portable msvc downloader

This commit is contained in:
doyle 2022-05-04 23:33:40 +10:00
parent 6ac89661f0
commit 92afd0282b
4 changed files with 661 additions and 462 deletions

View File

@ -1,13 +0,0 @@
@echo off
set dest_dir="%~dp0Windows_Symbols_PDBs"
set symchk="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symchk.exe"
if not exist %symchk% (
echo Symchk binary not found but is required to run script [path=%symchk%]
exit /b 1
)
if not exist %dest_dir% mkdir %dest_dir%
echo Downloading to %dest_dir% with %symchk%
%symchk% /r C:\Windows /s srv*%dest_dir%*https://msdl.microsoft.com/download/symbols
goto :eof

288
Tools/portable-msvc.py Normal file
View File

@ -0,0 +1,288 @@
#!/usr/bin/env python3
import io
import os
import sys
import json
import shutil
import hashlib
import zipfile
import tempfile
import argparse
import subprocess
import urllib.request
from pathlib import Path
OUTPUT = Path("msvc") # output folder
# other architectures may work or may not - not really tested
HOST = "x64" # or x86
TARGET = "x64" # or x86, arm, arm64
MANIFEST_URL = "https://aka.ms/vs/17/release/channel"
def download(url):
with urllib.request.urlopen(url) as res:
return res.read()
def download_progress(url, check, name, f):
data = io.BytesIO()
with urllib.request.urlopen(url) as res:
total = int(res.headers["Content-Length"])
size = 0
while True:
block = res.read(1<<20)
if not block:
break
f.write(block)
data.write(block)
size += len(block)
perc = size * 100 // total
print(f"\r{name} ... {perc}%", end="")
print()
data = data.getvalue()
digest = hashlib.sha256(data).hexdigest()
if check.lower() != digest:
exit(f"Hash mismatch for f{pkg}")
return data
# super crappy msi format parser just to find required .cab files
def get_msi_cabs(msi):
index = 0
while True:
index = msi.find(b".cab", index+4)
if index < 0:
return
yield msi[index-32:index+4].decode("ascii")
def first(items, cond):
return next(item for item in items if cond(item))
### parse command-line arguments
ap = argparse.ArgumentParser()
ap.add_argument("--show-versions", const=True, action="store_const", help="Show available MSVC and Windows SDK versions")
ap.add_argument("--accept-license", const=True, action="store_const", help="Automatically accept license")
ap.add_argument("--msvc-version", help="Get specific MSVC version")
ap.add_argument("--sdk-version", help="Get specific Windows SDK version")
args = ap.parse_args()
### get main manifest
manifest = json.loads(download(MANIFEST_URL))
### download VS manifest
vs = first(manifest["channelItems"], lambda x: x["id"] == "Microsoft.VisualStudio.Manifests.VisualStudio")
payload = vs["payloads"][0]["url"]
vsmanifest = json.loads(download(payload))
### find MSVC & WinSDK versions
packages = {}
for p in vsmanifest["packages"]:
packages.setdefault(p["id"].lower(), []).append(p)
msvc = {}
sdk = {}
for pid,p in packages.items():
if pid.startswith("Microsoft.VisualStudio.Component.VC.".lower()) and pid.endswith(".x86.x64".lower()):
pver = ".".join(pid.split(".")[4:6])
if pver[0].isnumeric():
msvc[pver] = pid
elif pid.startswith("Microsoft.VisualStudio.Component.Windows10SDK.".lower()) or \
pid.startswith("Microsoft.VisualStudio.Component.Windows11SDK.".lower()):
pver = pid.split(".")[-1]
if pver.isnumeric():
sdk[pver] = pid
if args.show_versions:
print("MSVC versions:", " ".join(sorted(msvc.keys())))
print("Windows SDK versions:", " ".join(sorted(sdk.keys())))
exit(0)
msvc_ver = args.msvc_version or max(sorted(msvc.keys()))
sdk_ver = args.sdk_version or max(sorted(sdk.keys()))
if msvc_ver in msvc:
msvc_pid = msvc[msvc_ver]
msvc_ver = ".".join(msvc_pid.split(".")[4:-2])
else:
exit(f"Unknown MSVC version: f{args.msvc_version}")
if sdk_ver in sdk:
sdk_pid = sdk[sdk_ver]
else:
exit(f"Unknown Windows SDK version: f{args.sdk_version}")
print(f"Downloading MSVC v{msvc_ver} and Windows SDK v{sdk_ver}")
### agree to license
tools = first(manifest["channelItems"], lambda x: x["id"] == "Microsoft.VisualStudio.Product.BuildTools")
resource = first(tools["localizedResources"], lambda x: x["language"] == "en-us")
license = resource["license"]
if not args.accept_license:
accept = input(f"Do you accept Visual Studio license at {license} [Y/N] ? ")
if not accept or accept[0].lower() != "y":
exit(0)
OUTPUT.mkdir(exist_ok=True)
total_download = 0
### download MSVC
msvc_packages = [
# MSVC binaries
f"microsoft.vc.{msvc_ver}.tools.host{HOST}.target{TARGET}.base",
f"microsoft.vc.{msvc_ver}.tools.host{HOST}.target{TARGET}.res.base",
# MSVC headers
f"microsoft.vc.{msvc_ver}.crt.headers.base",
# MSVC libs
f"microsoft.vc.{msvc_ver}.crt.{TARGET}.desktop.base",
f"microsoft.vc.{msvc_ver}.crt.{TARGET}.store.base",
# MSVC runtime source
f"microsoft.vc.{msvc_ver}.crt.source.base",
# ASAN
f"microsoft.vc.{msvc_ver}.asan.headers.base",
f"microsoft.vc.{msvc_ver}.asan.{TARGET}.base",
# MSVC redist
#f"microsoft.vc.{msvc_ver}.crt.redist.x64.base",
]
for pkg in msvc_packages:
p = first(packages[pkg], lambda p: p.get("language") in (None, "en-US"))
for payload in p["payloads"]:
with tempfile.TemporaryFile() as f:
data = download_progress(payload["url"], payload["sha256"], pkg, f)
total_download += len(data)
with zipfile.ZipFile(f) as z:
for name in z.namelist():
if name.startswith("Contents/"):
out = OUTPUT / Path(name).relative_to("Contents")
out.parent.mkdir(parents=True, exist_ok=True)
out.write_bytes(z.read(name))
### download Windows SDK
sdk_packages = [
# Windows SDK tools (like rc.exe & mt.exe)
f"Windows SDK for Windows Store Apps Tools-x86_en-us.msi",
# Windows SDK headers
f"Windows SDK for Windows Store Apps Headers-x86_en-us.msi",
# Windows SDK libs
f"Windows SDK for Windows Store Apps Libs-x86_en-us.msi",
f"Windows SDK Desktop Libs {TARGET}-x86_en-us.msi",
# CRT headers & libs
f"Universal CRT Headers Libraries and Sources-x86_en-us.msi",
# CRT redist
#"Universal CRT Redistributable-x86_en-us.msi",
]
with tempfile.TemporaryDirectory() as d:
dst = Path(d)
sdk_pkg = packages[sdk_pid][0]
sdk_pkg = packages[first(sdk_pkg["dependencies"], lambda x: True).lower()][0]
msi = []
cabs = []
# download msi files
for pkg in sdk_packages:
payload = first(sdk_pkg["payloads"], lambda p: p["fileName"] == f"Installers\\{pkg}")
msi.append(dst / pkg)
with open(dst / pkg, "wb") as f:
data = download_progress(payload["url"], payload["sha256"], pkg, f)
total_download += len(data)
cabs += list(get_msi_cabs(data))
# download .cab files
for pkg in cabs:
payload = first(sdk_pkg["payloads"], lambda p: p["fileName"] == f"Installers\\{pkg}")
with open(dst / pkg, "wb") as f:
download_progress(payload["url"], payload["sha256"], pkg, f)
print("Unpacking msi files...")
# run msi installers
for m in msi:
subprocess.check_call(["msiexec.exe", "/a", m, "/quiet", "/qn", f"TARGETDIR={OUTPUT.resolve()}"])
### versions
msvcv = list((OUTPUT / "VC/Tools/MSVC").glob("*"))[0].name
sdkv = list((OUTPUT / "Windows Kits/10/bin").glob("*"))[0].name
# place debug CRT runtime into MSVC folder (not what real Visual Studio installer does... but is reasonable)
dst = str(OUTPUT / "VC/Tools/MSVC" / msvcv / f"bin/Host{HOST}/{TARGET}")
pkg = "microsoft.visualcpp.runtimedebug.14"
dbg = packages[pkg][0]
payload = first(dbg["payloads"], lambda p: p["fileName"] == "cab1.cab")
try:
with tempfile.TemporaryFile(suffix=".cab", delete=False) as f:
data = download_progress(payload["url"], payload["sha256"], pkg, f)
total_download += len(data)
subprocess.check_call(["expand.exe", f.name, "-F:*", dst], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
finally:
os.unlink(f.name)
### cleanup
shutil.rmtree(OUTPUT / "Common7", ignore_errors=True)
for f in ["Auxiliary", f"lib/{TARGET}/store", f"lib/{TARGET}/uwp"]:
shutil.rmtree(OUTPUT / "VC/Tools/MSVC" / msvcv / f)
for f in OUTPUT.glob("*.msi"):
f.unlink()
for f in ["Catalogs", "DesignTime", f"bin/{sdkv}/chpe", f"Lib/{sdkv}/ucrt_enclave"]:
shutil.rmtree(OUTPUT / "Windows Kits/10" / f, ignore_errors=True)
for arch in ["x86", "x64", "arm", "arm64"]:
if arch != TARGET:
shutil.rmtree(OUTPUT / "VC/Tools/MSVC" / msvcv / f"bin/Host{arch}", ignore_errors=True)
shutil.rmtree(OUTPUT / "Windows Kits/10/bin" / sdkv / arch)
shutil.rmtree(OUTPUT / "Windows Kits/10/Lib" / sdkv / "ucrt" / arch)
shutil.rmtree(OUTPUT / "Windows Kits/10/Lib" / sdkv / "um" / arch)
### setup.bat
SETUP = f"""@echo off
set ROOT=%~dp0
set MSVC_VERSION={msvcv}
set MSVC_HOST=Host{HOST}
set MSVC_ARCH={TARGET}
set SDK_VERSION={sdkv}
set SDK_ARCH={TARGET}
set MSVC_ROOT=%ROOT%VC\\Tools\\MSVC\\%MSVC_VERSION%
set SDK_INCLUDE=%ROOT%Windows Kits\\10\\Include\\%SDK_VERSION%
set SDK_LIBS=%ROOT%Windows Kits\\10\\Lib\\%SDK_VERSION%
set VCToolsInstallDir=%MSVC_ROOT%\\
set PATH=%MSVC_ROOT%\\bin\\%MSVC_HOST%\\%MSVC_ARCH%;%ROOT%Windows Kits\\10\\bin\\%SDK_VERSION%\\%SDK_ARCH%\\ucrt;%PATH%
set INCLUDE=%MSVC_ROOT%\\include;%SDK_INCLUDE%\\ucrt;%SDK_INCLUDE%\\shared;%SDK_INCLUDE%\\um;%SDK_INCLUDE%\\winrt;%SDK_INCLUDE%\\cppwinrt
set LIB=%MSVC_ROOT%\\lib\\%MSVC_ARCH%;%SDK_LIBS%\\ucrt\\%SDK_ARCH%;%SDK_LIBS%\\um\\%SDK_ARCH%
"""
with open(OUTPUT / "setup.bat", "w") as f:
print(SETUP, file=f)
print(f"Total downloaded: {total_download>>20} MB")
print("Done!")

View File

@ -1,8 +1,6 @@
@echo off
setlocal EnableDelayedExpansion
call win32_install_config.bat
REM ----------------------------------------------------------------------------
REM Setup Folder Locations
REM ----------------------------------------------------------------------------
@ -105,7 +103,6 @@ REM Download & verify the tools we want for development
REM ----------------------------------------------------------------------------
REM Wezterm
REM ----------------------------------------------------------------------------
if !install_wezterm! == 1 (
set wezterm_sha256=c634e98fa9715766bbb00cbc3c8a23d1d558c8cd5716ad2efca45ed4e0ef82f9
set wezterm_exe_sha256=b9b5bae20d0679127ca0c4da276dff3b7b32310bfbfaede26a9b8ecb55e295ce
set wezterm_version=20220408-101518-b908e2dd
@ -123,7 +120,6 @@ if !install_wezterm! == 1 (
call :VerifyFileSHA256 "!wezterm_exe!" "!wezterm_version!" "!wezterm_exe_sha256!" || exit /B
call :CopyAndAlwaysOverwriteFile "!install_dir!\wezterm.lua" "!wezterm_dir!\wezterm.lua" || exit /B
)
REM ----------------------------------------------------------------------------
REM Jetbrains Mono Font
@ -150,7 +146,6 @@ REM ----------------------------------------------------------------------------
REM ----------------------------------------------------------------------------
REM Git
REM ----------------------------------------------------------------------------
if !install_git! == 1 (
set git_sha256=bc030848e282d49e562ae2392a72501cf539322ad06ffe4cea8cf766f148dfe8
set git_exe_sha256=ae463cad04c2b15fc91de68ab096933ec08c44752e205aebd7d64c3a482df62d
set git_version=2.33.0
@ -168,12 +163,10 @@ if !install_git! == 1 (
)
call :VerifyFileSHA256 "!git_exe!" "!git_version!" "!git_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM LLVM/Clang
REM ----------------------------------------------------------------------------
if !install_llvm_clang! == 1 (
set llvm_exe_sha256=9f0748de7f946c210a030452de226986bab46a0121d7236ea0e7b5079cb6dfef
set llvm_version=12.0.1
@ -194,21 +187,18 @@ if !install_llvm_clang! == 1 (
call :Unzip "!llvm_zip!" "!llvm_dir!" || exit /B
)
if !install_gvim! == 1 (
REM Clang Format
set clang_format_py_sha256=36ba7aa047f8a8ac8fdc278aaa733de801cc84dea60a4210973fd3e4f0d2a330
set vim_clang_format=!vim_dir!\clang-format.py
call :CopyAndAlwaysOverwriteFile "!llvm_dir!\share\clang\clang-format.py" "!vim_clang_format!" || exit /B
call :VerifyFileSHA256 "!vim_clang_format!" "!llvm_version!" "!clang_format_py_sha256!" || exit /B
)
set llvm_bin_dir=!llvm_dir!\bin
call :VerifyFileSHA256 "!llvm_exe!" "!llvm_version!" "!llvm_exe_sha256!" || exit /B
)
REM ------------------------------------------------------------------------
REM MinGW64
REM ------------------------------------------------------------------------
if !install_mingw64! == 1 (
set mingw_sha256=853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8
set mingw_exe_sha256=c5f0953f7a71ddcdf0852e1e44a43cef9b8fe121beba4d4202bfe6d405de47c0
set mingw_version=8.1.0
@ -226,12 +216,10 @@ if !install_mingw64! == 1 (
)
call :VerifyFileSHA256 "!mingw_exe!" "!mingw_version!" "!mingw_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM nodejs
REM ----------------------------------------------------------------------------
if !install_nodejs! == 1 (
set nodejs_sha256=f7b0e8b0bfcfad7d62eba16fa4db9f085983c12c661bd4c66d8e3bd783befa65
set nodejs_exe_sha256=7f33cbe04cb2940427e6dd97867c1fcf3ddd60911d2ae0260da3cab9f6ea6365
set nodejs_version=16.7.0
@ -248,12 +236,10 @@ if !install_nodejs! == 1 (
)
call :VerifyFileSHA256 "!nodejs_exe!" "!nodejs_version!" "!nodejs_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Python
REM ----------------------------------------------------------------------------
if !install_python3! == 1 (
set python_sha256=93cc3db75dffb4d56b9f64af43294f130f2c222a66de7a1325d0ce8f1ed62e26
set python_exe_sha256=9042daa88b2d3879a51bfabc2d90d4a56da05ebf184b6492a22a46fdc1c936a4
set python_version=3.9.0.2dot
@ -275,12 +261,10 @@ if !install_python3! == 1 (
set python_bin_dir=!python_dir!\python-!python_version_dot!.amd64
set python_scripts_bin_dir=!python_bin_dir!\Scripts
)
REM ----------------------------------------------------------------------------
REM RenderDoc
REM ----------------------------------------------------------------------------
if !install_renderdoc! == 1 (
set renderdoc_sha256=a97a9911850c8a93dc1dee8f94e339cd5933310513dddf0216d27cea3a5f25b1
set renderdoc_exe_sha256=27c28b813f01781573507b0d9b47546d323ae8add2695bbd03b941461868a7a2
set renderdoc_version=1.18
@ -297,12 +281,10 @@ if !install_renderdoc! == 1 (
)
call :VerifyFileSHA256 "!renderdoc_exe!" "!renderdoc_version!" "!renderdoc_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Zig
REM ----------------------------------------------------------------------------
if !install_zig! == 1 (
set zig_sha256=43573db14cd238f7111d6bdf37492d363f11ecd1eba802567a172f277d003926
set zig_exe_sha256=465739a787178ded19efab55916b587f3ead2a9cdff8dcaaf1765fe907797917
set zig_version=0.8.1
@ -320,15 +302,35 @@ if !install_zig! == 1 (
call :VerifyFileSHA256 "!zig_exe!" "!zig_version!" "!zig_exe_sha256!" || exit /B
call :MakeBatchShortcutInBinDir "zig" "!zig_exe!"
REM ----------------------------------------------------------------------------
REM MSVC
REM ----------------------------------------------------------------------------
set msvc_version=14.31
set msvc_sdk_version=22000
set msvc_dir=!tools_dir!\msvc-v!msvc_version!-win10-sdk-v!msvc_sdk_version!-x64
if not exist "!msvc_dir!" (
call "!python_exe!" !tools_dir!\portable-msvc.py --accept-license --msvc-version !msvc_version! --sdk-version !msvc_sdk_version! || exit /B
call :Move "!tools_dir!\msvc" "!msvc_dir!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Symget
REM ----------------------------------------------------------------------------
set symget_dir=!tools_dir!\symget
if not exist "!symget_dir!" (
call !git_exe! clone https://github.com/mmozeiko/symget.git !symget_dir! || exit /B
)
call !git_exe! -C !symget_dir! pull origin main || exit /B
call !git_exe! -C !symget_dir! checkout 79b026f || exit /B
REM ----------------------------------------------------------------------------
REM QoL/Tools
REM ----------------------------------------------------------------------------
REM ----------------------------------------------------------------------------
REM clink - Bash style tab completion in terminal
REM ----------------------------------------------------------------------------
if !install_clink! == 1 (
set clink_sha256=31e286313e67a7269ca09ae142e569af7962b03b8f2bc7bd99240416222d8ee8
set clink_exe_sha256=38b1bb5a8392ac8d7f98d3dcc0a41dc7fc31344800d4facd83e10d9175daf9d8
set clink_version=1.3.13
@ -351,20 +353,17 @@ if !install_clink! == 1 (
call :VerifyFileSHA256 "!clink_exe!" "!clink_version!" "!clink_exe_sha256!" || exit /B
call :MakeBatchShortcutInBinDir "clink" "!clink_bat!"
if !install_git! == 1 (
REM Clink Completion Addon
set clink_completions_dir=!tools_dir!\clink-completions
if not exist "!clink_completions_dir!" (
call !git_exe! clone https://github.com/vladimir-kotikov/clink-completions !clink_completions_dir! || exit /B
)
call !git_exe! -C !clink_completions_dir! pull origin master || exit /B
call !git_exe! -C !clink_completions_dir! checkout 9ab9342 || exit /B
)
)
REM ----------------------------------------------------------------------------
REM Dependencies (Walker) - For DLL dependency management
REM ----------------------------------------------------------------------------
if !install_dependency_walker! == 1 (
set dependencies_sha256=44df956dbe267e0a705224c3b85d515fee2adc87509861e24fb6c6b0ea1b86d6
set dependencies_exe_sha256=f9c9d78284d03b0457061cfb33751071c8c1ceeb26bc9b75ae9b7e0465e99858
set dependencies_version=v1.10
@ -380,12 +379,10 @@ if !install_dependency_walker! == 1 (
)
call :VerifyFileSHA256 "!dependencies_exe!" "!dependencies_version!" "!dependencies_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM everything (void tools search program)
REM ----------------------------------------------------------------------------
if !install_everything_void_tools! == 1 (
set everything_sha256=f61b601acba59d61fb0631a654e48a564db34e279b6f2cc45e20a42ce9d9c466
set everything_exe_sha256=48a17c3c22476f642c2b1ab2da8dfd789e39882997d7a8e266104f7404a0ded9
set everything_version=1.4.1.1009
@ -401,12 +398,10 @@ if !install_everything_void_tools! == 1 (
)
call :VerifyFileSHA256 "!everything_exe!" "!everything_version!" "!everything_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM fzf
REM ----------------------------------------------------------------------------
if !install_fzf! == 1 (
set fzf_sha256=f0797ceee089017108c80b09086c71b8eec43d4af11ce939b78b1d5cfd202540
set fzf_exe_sha256=5176c4c90957aa7e3d12f91b8ba55acac7524a83998517119ee19b61f4534140
set fzf_version=0.29.0
@ -422,12 +417,10 @@ if !install_fzf! == 1 (
)
call :VerifyFileSHA256 "!fzf_exe!" "!fzf_version!" "!fzf_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM GVim, Vim Plug, Vim Config
REM ----------------------------------------------------------------------------
if !install_gvim! == 1 (
set gvim_zip=!downloads_dir!\win32_gvim_x64.7z
set gvim_dir=!tools_dir!\GVim
if not exist "!gvim_dir!\gvim.exe" (
@ -447,12 +440,10 @@ if !install_gvim! == 1 (
set vim_plug=!vim_plug_dir!\plug.vim
if not exist "!vim_plug_dir!" mkdir "!vim_plug_dir!"
call :DownloadFile "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" "!vim_plug!" || exit /B
)
REM ----------------------------------------------------------------------------
REM ImHex
REM ----------------------------------------------------------------------------
if !install_imhex! == 1 (
set imhex_sha256=080f537d3ea58c002cc2112adbec1352144710b43764de9a1dc04f129d3a3343
set imhex_exe_sha256=6a4b0e70bf7c78af074af0de2346164d9f5aec28ea224f9ee903412e1c774d95
set imhex_version=1.17.0
@ -468,12 +459,10 @@ if !install_imhex! == 1 (
)
call :VerifyFileSHA256 "!imhex_exe!" "!imhex_version!" "!imhex_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Joplin
REM ----------------------------------------------------------------------------
if !install_joplin! == 1 (
set joplin_sha256=2dba85ba6887d9318b10aafda00531f804f311ef9d1c899eefbcba116bf50ed2
set joplin_version=2.6.10
@ -486,12 +475,10 @@ if !install_joplin! == 1 (
)
call :VerifyFileSHA256 "!joplin_exe!" "!joplin_version!" "!joplin_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Keypirinha
REM ----------------------------------------------------------------------------
if !install_keypirinha! == 1 (
set keypirinha_sha256=d109a16e6a5cf311abf6d06bbe5b1be3b9ba323b79c32a168628189e10f102a5
set keypirinha_exe_sha256=2d3adb36a04e9fdf94636c9ac5d4c2b754accbfaecd81f4ee7189c3c0edc8af1
set keypirinha_version=2.26
@ -508,7 +495,6 @@ if !install_keypirinha! == 1 (
)
call :VerifyFileSHA256 "!keypirinha_exe!" "!keypirinha_version!" "!keypirinha_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Misc Tools
@ -524,7 +510,6 @@ call :CopyAndAlwaysOverwriteFile "!install_dir!\clang_format_style_file" "!home_
REM ------------------------------------------------------------------------
REM MobaXTerm
REM ------------------------------------------------------------------------
if !install_mobaxterm! == 1 (
set mobaxterm_sha256=91f80537f12c2ad34a5eba99a285c149781c6d35a144a965ce3aea8a9bc6868c
set mobaxterm_exe_sha256=1053c81b44018d6e6519a9c80d7413f7bb36e9f6e43b3da619b2229aa362a522
set mobaxterm_version=21.2
@ -540,13 +525,10 @@ if !install_mobaxterm! == 1 (
)
call :VerifyFileSHA256 "!mobaxterm_exe!" "!mobaxterm_version!" "!mobaxterm_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM O&O ShutUp10 (Privacy Tool for Windows)
REM ----------------------------------------------------------------------------
if !install_ooshutup10! == 1 (
REM We don't do SHA256 here since we don't get a versioned URL, this can
REM change at a whim and it'd be painful to have to reupdate the script
REM everytime.
@ -558,12 +540,10 @@ if !install_ooshutup10! == 1 (
if not exist "!oo_shutup_10_dir!" mkdir "!oo_shutup_10_dir!"
call :DownloadFile "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" "!oo_shutup_10_file!" || exit /B
)
)
REM ----------------------------------------------------------------------------
REM ProcessHacker
REM ----------------------------------------------------------------------------
if !install_process_hacker! == 1 (
set process_hacker_sha256=e8836365abab7478d8e4c2d3fb3bb1fce82048cd4da54bab41cacbae1f45b1ff
set process_hacker_exe_sha256=46367bfcf4b150da573a74d91aa2f7caf7a0789741bc65878a028e91ffbf5e42
set process_hacker_version=3.0.4212
@ -579,12 +559,10 @@ if !install_process_hacker! == 1 (
)
call :VerifyFileSHA256 "!process_hacker_exe!" "!process_hacker_version!" "!process_hacker_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM ripgrep
REM ----------------------------------------------------------------------------
if !install_ripgrep! == 1 (
set rg_sha256=a47ace6f654c5ffa236792fc3ee3fefd9c7e88e026928b44da801acb72124aa8
set rg_exe_sha256=ab5595a4f7a6b918cece0e7e22ebc883ead6163948571419a1dd5cd3c7f37972
set rg_version=13.0.0
@ -602,7 +580,6 @@ if !install_ripgrep! == 1 (
call :VerifyFileSHA256 "!rg_exe!" "!rg_version!" "!rg_exe_sha256!" || exit /B
call :MakeBatchShortcutInBinDir "rg" "!rg_exe!"
)
REM ----------------------------------------------------------------------------
REM Ethereum
@ -610,7 +587,6 @@ REM ----------------------------------------------------------------------------
REM ----------------------------------------------------------------------------
REM geth
REM ----------------------------------------------------------------------------
if !install_geth! == 1 (
set geth_md5=a975ba6591577b6f5b19f4fd8757fd03
set geth_exe_sha256=7d9fd1566f2fd07c741a64aad2865b25f8cd82388e15bed2d68e92105b1e0fd3
set geth_version=1.10.8-26675454
@ -634,12 +610,10 @@ if !install_geth! == 1 (
call :VerifyFileSHA256 "!geth_exe!" "!geth_version!" "!geth_exe_sha256!" || exit /B
call :MakeBatchShortcutInBinDir "geth" "!geth_exe!"
)
REM ----------------------------------------------------------------------------
REM remix_ide
REM ----------------------------------------------------------------------------
if !install_remix_ide! == 1 (
set remix_ide_sha256=19a56cb79459e612d8cbdd6b6729d06c7080d983537d2494a15fd25ea67b2499
set remix_ide_exe_sha256=960bc454e37a718b86018b596d14ed977d1a8e1a5bc57b5afd573fc5e9b84a47
set remix_ide_version=1.3.1
@ -655,12 +629,10 @@ if !install_remix_ide! == 1 (
)
call :VerifyFileSHA256 "!remix_ide_exe!" "!remix_ide_version!" "!remix_ide_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM solidity
REM ----------------------------------------------------------------------------
if !install_solidity! == 1 (
set solidity_exe_sha256=82db83111c6e2c892179486cb7050d85f1517bf851027607eb7f4e589e714bc5
set solidity_version=0.8.7+commit.e28d00a7
@ -674,13 +646,11 @@ if !install_solidity! == 1 (
call :VerifyFileSHA256 "!solidity_exe!" "!solidity_version!" "!solidity_exe_sha256!" || exit /B
call :MakeBatchShortcutInBinDir "solc" "!solidity_exe!"
)
REM ----------------------------------------------------------------------------
REM Super Terminal
REM ----------------------------------------------------------------------------
set terminal_script=!root_dir!\win32_terminal.bat
set msvc_script=!tools_dir!\MSVC-2019-v16.9.2-VC-v14.28.29910-Win10-SDK-v10.0.19041.0-x64\msvc_env_x64.bat
echo @echo off> "!terminal_script!"
@ -692,54 +662,49 @@ echo set LOCALAPPDATA=%%~dp0!home_dir!\AppData\Local>> "!terminal_script!"
echo set PATH=%%~dp0!gpg_w32_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!bin_dir!;%%PATH%%>> "!terminal_script!"
if !install_clink! == 1 (
if !install_git! == 1 (
REM Clink
echo set CLINK_PATH=%%~dp0!clink_completions_dir!>> "!terminal_script!
)
)
if !install_fzf! == 1 (
REM FZF
echo set FZF_DEFAULT_OPTS=--multi --layout=reverse>> "!terminal_script!"
REM Use RG for FZF to make it ultra fast
if !install_ripgrep! == 1 (
echo set FZF_DEFAULT_COMMAND=rg --files --no-ignore-vcs --hidden>> "!terminal_script!"
)
)
if !install_git! == 1 (
REM Git
echo set PATH=%%~dp0!git_install_dir!\cmd;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!git_install_dir!\mingw64\bin;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!git_install_dir!\usr\bin;%%PATH%%>> "!terminal_script!"
)
if !install_gvim! == 1 ( echo set PATH=%%~dp0!gvim_dir!;%%PATH%%>> "!terminal_script!" )
if !install_llvm_clang! == 1 ( echo set PATH=%%~dp0!llvm_bin_dir!;%%PATH%%>> "!terminal_script!" )
if !install_mingw64! == 1 ( echo set PATH=%%~dp0!mingw_bin_dir!;%%PATH%%>> "!terminal_script!" )
if !install_nodejs! == 1 ( echo set PATH=%%~dp0!nodejs_dir!;%%PATH%%>> "!terminal_script!" )
REM GVim/Clang/MinGW/NodeJS
echo set PATH=%%~dp0!gvim_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!llvm_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!mingw_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!nodejs_dir!;%%PATH%%>> "!terminal_script!"
if !install_python3! == 1 (
REM Python3
echo set PATH=%%~dp0!python_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!python_scripts_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PYTHONHOME=%%~dp0!python_bin_dir!>> "!terminal_script!"
)
echo set PATH=%%~dp0!zip7_dir!;%%PATH%%>> "!terminal_script!"
echo if exist "%%~dp0!msvc_script!" call "%%~dp0!msvc_script!">> "!terminal_script!"
REM MSVC
echo call "%%~dp0!msvc_dir!\setup.bat">> "!terminal_script!"
echo if exist "%%~dp0win32_terminal_user_config.bat" call "%%~dp0win32_terminal_user_config.bat">> "!terminal_script!"
if !install_wezterm! == 1 (
REM WezTerm
echo start "" /MAX "%%~dp0!wezterm_exe!">> "!terminal_script!"
echo exit>> "!terminal_script!"
)
REM ----------------------------------------------------------------------------
REM Background Application Scripts
REM ----------------------------------------------------------------------------
set terminal_script=!root_dir!\win32_start_background_apps.bat
echo @echo off> "!terminal_script!"
if !install_everything_void_tools! == 1 echo start "" "%%~dp0!everything_dir!\everything.exe">> "!terminal_script!"
if !install_keypirinha! == 1 echo start "" "%%~dp0!keypirinha_dir!\keypirinha.exe">> "!terminal_script!"
echo start "" "%%~dp0!everything_dir!\everything.exe">> "!terminal_script!"
echo start "" "%%~dp0!keypirinha_dir!\keypirinha.exe">> "!terminal_script!"
REM ----------------------------------------------------------------------------
REM CTags Helper Script

View File

@ -1,41 +0,0 @@
@echo off
REM ----------------------------------------------------------------------------
REM Installation Configuration
REM ----------------------------------------------------------------------------
REM Set the 0 or 1 to enable or disable installation of a package
set install_wezterm=1
REM ----------------------------------------------------------------------------
REM Programming
REM ----------------------------------------------------------------------------
set install_git=1
set install_llvm_clang=1
set install_mingw64=1
set install_nodejs=1
set install_python3=1
set install_renderdoc=1
set install_zig=1
REM ----------------------------------------------------------------------------
REM QoL/Tools
REM ----------------------------------------------------------------------------
set install_clink=1
set install_dependency_walker=1
set install_everything_void_tools=1
set install_fzf=1
set install_gvim=1
set install_imhex=1
set install_joplin=1
set install_keypirinha=1
set install_mobaxterm=1
set install_ooshutup10=1
set install_process_hacker=1
set install_ripgrep=1
REM ----------------------------------------------------------------------------
REM Ethereum
REM ----------------------------------------------------------------------------
set install_geth=1
set install_remix_ide=1
set install_solidity=1