diff options
author | Nobuyoshi Nakada <[email protected]> | 2025-05-29 20:09:47 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2025-05-30 18:44:28 +0900 |
commit | a333fb1eccf5218559c89bd51753e48a8a156ade (patch) | |
tree | 17bdc94196ddae7434b78c75908fa8af78474993 /win32 | |
parent | 9f91f3617bab2ee220d298ddb874ef73b10dac23 (diff) |
Win: Add scripts to install and setup
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13473
Diffstat (limited to 'win32')
-rw-r--r-- | win32/install-buildtools.cmd | 14 | ||||
-rw-r--r-- | win32/vssetup.cmd | 24 |
2 files changed, 38 insertions, 0 deletions
diff --git a/win32/install-buildtools.cmd b/win32/install-buildtools.cmd new file mode 100644 index 0000000000..088ae33d12 --- /dev/null +++ b/win32/install-buildtools.cmd @@ -0,0 +1,14 @@ +@echo off +setlocal + +set components=VC.Tools.x86.x64 VC.Redist.14.Latest CoreBuildTools +set components=%components% Windows11SDK.26100 +if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" ( + set components=%components% VC.Tools.ARM64 VC.Tools.ARM64EC +) +set override=--passive +for %%I in (%components%) do ( + call set override=%%override%% --add Microsoft.VisualStudio.Component.%%I +) +echo on +winget uninstall --id Microsoft.VisualStudio.2022.BuildTools --override "%override%" diff --git a/win32/vssetup.cmd b/win32/vssetup.cmd new file mode 100644 index 0000000000..01487f9098 --- /dev/null +++ b/win32/vssetup.cmd @@ -0,0 +1,24 @@ +@echo off +setlocal + +::- check for vswhere +set vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe +if not exist "%vswhere%" ( + echo 1>&2 vswhere.exe not found + exit /b 1 +) + +::- find the latest build tool and its setup batch file. +set VCVARS= +for /f "delims=" %%I in ('"%vswhere%" -products * -latest -property installationPath') do ( + set VCVARS=%%I\VC\Auxiliary\Build\vcvarsall.bat +) +if not defined VCVARS ( + echo 1>&2 Visual Studio not found + exit /b 1 +) + +::- If no target is given, setup for the current processor. +set target= +if "%1" == "" set target=%PROCESSOR_ARCHITECTURE% +echo on && endlocal && "%VCVARS%" %target% %* |