diff --git a/.github/workflows/scripts/windows/build-dependencies-arm64.bat b/.github/workflows/scripts/windows/build-dependencies-arm64.bat index 7328b0b2e2..573816f5e3 100644 --- a/.github/workflows/scripts/windows/build-dependencies-arm64.bat +++ b/.github/workflows/scripts/windows/build-dependencies-arm64.bat @@ -2,17 +2,24 @@ setlocal enabledelayedexpansion echo Setting environment... +rem Favour VS2022 over VS2026 for now. if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( for /f "usebackq tokens=*" %%i in (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[17, 18)" -latest -property installationPath`) do set "VSINSTPATH=%%i" if defined VSINSTPATH ( echo VSINSTPATH=!VSINSTPATH! call "!VSINSTPATH!\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" || goto error ) else ( - echo Visual Studio 2022 not found. - goto error + for /f "usebackq tokens=*" %%i in (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[18, 19)" -latest -property installationPath`) do set "VSINSTPATH=%%i" + if defined VSINSTPATH ( + echo VSINSTPATH=!VSINSTPATH! + call "!VSINSTPATH!\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" || goto error + ) else ( + echo Visual Studio not found. + goto error + ) ) ) else ( - echo Visual Studio 2022 not found. + echo Visual Studio not found. goto error ) diff --git a/.github/workflows/scripts/windows/build-dependencies.bat b/.github/workflows/scripts/windows/build-dependencies.bat index 71cd13262c..e402e85b47 100644 --- a/.github/workflows/scripts/windows/build-dependencies.bat +++ b/.github/workflows/scripts/windows/build-dependencies.bat @@ -2,17 +2,24 @@ setlocal enabledelayedexpansion echo Setting environment... +rem Favour VS2022 over VS2026 for now. if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( for /f "usebackq tokens=*" %%i in (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[17, 18)" -latest -property installationPath`) do set "VSINSTPATH=%%i" if defined VSINSTPATH ( echo VSINSTPATH=!VSINSTPATH! call "!VSINSTPATH!\VC\Auxiliary\Build\vcvars64.bat" || goto error ) else ( - echo Visual Studio 2022 not found. - goto error + for /f "usebackq tokens=*" %%i in (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[18, 19)" -latest -property installationPath`) do set "VSINSTPATH=%%i" + if defined VSINSTPATH ( + echo VSINSTPATH=!VSINSTPATH! + call "!VSINSTPATH!\VC\Auxiliary\Build\vcvars64.bat" || goto error + ) else ( + echo Visual Studio not found. + goto error + ) ) ) else ( - echo Visual Studio 2022 not found. + echo Visual Studio not found. goto error )