Win: Add scripts to install and setup

This commit is contained in:
Nobuyoshi Nakada 2025-05-29 20:09:47 +09:00
parent 9f91f3617b
commit a333fb1ecc
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
Notes: git 2025-05-30 10:58:56 +00:00
4 changed files with 43 additions and 30 deletions

View file

@ -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%"

24
win32/vssetup.cmd Normal file
View file

@ -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% %*