diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 37d7846f3f..5a75ce9ca2 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -42,6 +42,8 @@ jobs: name: Build Submodules runs-on: ${{ inputs.runs-on }} steps: + - name: Install VS2022 BuildTools 17.9.7 + run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel" - name: Setup Git run: | git config --global core.autocrlf false @@ -142,6 +144,8 @@ jobs: needs: codegen runs-on: ${{ inputs.runs-on }} steps: + - name: Install VS2022 BuildTools 17.9.7 + run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel" - name: Setup Git run: | git config --global core.autocrlf false @@ -221,6 +225,8 @@ jobs: - build-zig - codegen steps: + - name: Install VS2022 BuildTools 17.9.7 + run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel" - name: Setup Git run: | git config --global core.autocrlf false diff --git a/scripts/env.ps1 b/scripts/env.ps1 index 90cc0756a1..59b06facae 100644 --- a/scripts/env.ps1 +++ b/scripts/env.ps1 @@ -24,6 +24,9 @@ if ($env:VSINSTALLDIR -eq $null) { } Push-Location $vsDir try { + Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll' + Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64' + } catch { $launchps = (Join-Path -Path $vsDir -ChildPath "Common7\Tools\Launch-VsDevShell.ps1") . $launchps -Arch amd64 -HostArch amd64 } finally { Pop-Location }