File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 build :
1515 permissions :
1616 contents : write
17- runs-on : windows-latest
17+ runs-on : windows-2025-vs2026
1818
1919 # Steps represent a sequence of tasks that will be executed as part of the job
2020 steps :
@@ -142,11 +142,25 @@ jobs:
142142 id : vswhere
143143 shell : pwsh
144144 run : |
145- $installPath = vswhere -latest -products * -version "[18.0,19.0)" `
146- -requires Microsoft.Component.MSBuild -property installationPath
145+ $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
146+ if (-not (Test-Path $vswhere)) {
147+ throw "Could not find vswhere.exe at $vswhere"
148+ }
149+
150+ $installPath = & $vswhere -latest -products * -version "[18.0,19.0)" `
151+ -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
152+
147153 if (-not $installPath) {
148- throw 'VS 2026 (major 18) not found'
154+ Write-Host 'VS 2026 (major 18) not found on runner. Falling back to VS 2022 (major 17).'
155+ $installPath = & $vswhere -latest -products * -version "[17.0,18.0)" `
156+ -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
149157 }
158+
159+ if (-not $installPath) {
160+ throw "Could not find a Visual Studio installation"
161+ }
162+
163+ "VS=$installPath" >> $env:GITHUB_ENV
150164 "installPath=$installPath" >> $env:GITHUB_OUTPUT
151165
152166 # download vs installer builder (v2.0.1)
You can’t perform that action at this time.
0 commit comments