Skip to content

Commit 4aee24a

Browse files
committed
CI: quote VS install path and move to v145 toolset for VS 18
The windows-latest/windows-11-arm runners upgraded to Visual Studio 18. Start-Process -ArgumentList <array> did not quote the space in the new install path (C:\Program Files\Microsoft Visual Studio\18\Enterprise), truncating --installPath to C:\Program and failing the ATL modify. Pass a single quoted argument string. Also switch the native C++ builds from the v143 toolset to v145, matching VS 18 and the local build scripts.
1 parent 4304903 commit 4aee24a

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,16 @@ jobs:
105105
$components += "Microsoft.VisualStudio.Component.VC.ATL.ARM64"
106106
}
107107
108-
$vsArgs = @("modify", "--installPath", $vsPath, "--quiet", "--norestart", "--force", "--nocache")
109-
foreach ($c in $components) { $vsArgs += @("--add", $c) }
108+
# Build a single argument string so the install path (which contains
109+
# spaces, e.g. "C:\Program Files\Microsoft Visual Studio\18\Enterprise")
110+
# is passed quoted. Start-Process with an -ArgumentList ARRAY does not
111+
# quote elements that contain spaces, which truncated --installPath to
112+
# "C:\Program" and made the modify fail with "product cannot be found".
113+
$addArgs = ($components | ForEach-Object { "--add $_" }) -join " "
114+
$argString = "modify --installPath `"$vsPath`" --quiet --norestart --force --nocache $addArgs"
110115
111116
Write-Host "Installing ATL components: $($components -join ', ')"
112-
$proc = Start-Process -FilePath "$vsInstaller\setup.exe" -ArgumentList $vsArgs -Wait -PassThru -NoNewWindow
117+
$proc = Start-Process -FilePath "$vsInstaller\setup.exe" -ArgumentList $argString -Wait -PassThru -NoNewWindow
113118
Write-Host "VS Installer exit code: $($proc.ExitCode)"
114119
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne 3010) {
115120
Write-Error "VS Installer modify failed with exit code $($proc.ExitCode)."
@@ -194,8 +199,8 @@ jobs:
194199
# Step 2 -- Native C++: FlyNativeLib.dll, FlyNativeLibHeif.dll,
195200
# FlyContextMenuHelper.exe
196201
# -----------------------------------------------------------------------
197-
# PlatformToolset=v143 targets VS 2022 (all versions). The local scripts
198-
# use v145 but CI uses v143 for broader runner compatibility.
202+
# PlatformToolset=v145 matches the toolset shipped with Visual Studio 18
203+
# (now on the windows-latest / windows-11-arm runners) and the local scripts.
199204
# Build order matters: FlyNativeLib has no vcpkg dependency and must be
200205
# built before FlyNativeLibHeif which links against heif.lib.
201206
# Output lands in Src/<Platform>/Release/ (not Src/<Project>/<Platform>/Release/).
@@ -207,7 +212,7 @@ jobs:
207212
msbuild FlyNativeLib.vcxproj `
208213
/p:Configuration=Release `
209214
/p:Platform=${{ matrix.platform }} `
210-
/p:PlatformToolset=v143
215+
/p:PlatformToolset=v145
211216
212217
- name: Build FlyNativeLibHeif
213218
if: ${{ inputs.native == 'Build fresh' }}
@@ -216,7 +221,7 @@ jobs:
216221
msbuild FlyNativeLibHeif.vcxproj `
217222
/p:Configuration=Release `
218223
/p:Platform=${{ matrix.platform }} `
219-
/p:PlatformToolset=v143
224+
/p:PlatformToolset=v145
220225
221226
- name: Build FlyContextMenuHelper
222227
if: ${{ inputs.native == 'Build fresh' }}
@@ -225,7 +230,7 @@ jobs:
225230
msbuild FlyContextMenuHelper.vcxproj `
226231
/p:Configuration=Release `
227232
/p:Platform=${{ matrix.platform }} `
228-
/p:PlatformToolset=v143
233+
/p:PlatformToolset=v145
229234
230235
# -----------------------------------------------------------------------
231236
# Step 3 -- Rust: fly_rust_bridge.dll (RAW decode + SVG render)

.github/workflows/build_installer.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,16 @@ jobs:
106106
$components += "Microsoft.VisualStudio.Component.VC.ATL.ARM64"
107107
}
108108
109-
$vsArgs = @("modify", "--installPath", $vsPath, "--quiet", "--norestart", "--force", "--nocache")
110-
foreach ($c in $components) { $vsArgs += @("--add", $c) }
109+
# Build a single argument string so the install path (which contains
110+
# spaces, e.g. "C:\Program Files\Microsoft Visual Studio\18\Enterprise")
111+
# is passed quoted. Start-Process with an -ArgumentList ARRAY does not
112+
# quote elements that contain spaces, which truncated --installPath to
113+
# "C:\Program" and made the modify fail with "product cannot be found".
114+
$addArgs = ($components | ForEach-Object { "--add $_" }) -join " "
115+
$argString = "modify --installPath `"$vsPath`" --quiet --norestart --force --nocache $addArgs"
111116
112117
Write-Host "Installing ATL components: $($components -join ', ')"
113-
$proc = Start-Process -FilePath "$vsInstaller\setup.exe" -ArgumentList $vsArgs -Wait -PassThru -NoNewWindow
118+
$proc = Start-Process -FilePath "$vsInstaller\setup.exe" -ArgumentList $argString -Wait -PassThru -NoNewWindow
114119
Write-Host "VS Installer exit code: $($proc.ExitCode)"
115120
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne 3010) {
116121
Write-Error "VS Installer modify failed with exit code $($proc.ExitCode)."
@@ -195,8 +200,8 @@ jobs:
195200
# Step 2 -- Native C++: FlyNativeLib.dll, FlyNativeLibHeif.dll,
196201
# FlyContextMenuHelper.exe
197202
# -----------------------------------------------------------------------
198-
# PlatformToolset=v143 targets VS 2022 (all versions). The local scripts
199-
# use v145 but CI uses v143 for broader runner compatibility.
203+
# PlatformToolset=v145 matches the toolset shipped with Visual Studio 18
204+
# (now on the windows-latest / windows-11-arm runners) and the local scripts.
200205
# Build order matters: FlyNativeLib has no vcpkg dependency and must be
201206
# built before FlyNativeLibHeif which links against heif.lib.
202207
# Output lands in Src/<Platform>/Release/ (not Src/<Project>/<Platform>/Release/).
@@ -208,7 +213,7 @@ jobs:
208213
msbuild FlyNativeLib.vcxproj `
209214
/p:Configuration=Release `
210215
/p:Platform=${{ matrix.platform }} `
211-
/p:PlatformToolset=v143
216+
/p:PlatformToolset=v145
212217
213218
- name: Build FlyNativeLibHeif
214219
if: ${{ inputs.native == 'Build fresh' }}
@@ -217,7 +222,7 @@ jobs:
217222
msbuild FlyNativeLibHeif.vcxproj `
218223
/p:Configuration=Release `
219224
/p:Platform=${{ matrix.platform }} `
220-
/p:PlatformToolset=v143
225+
/p:PlatformToolset=v145
221226
222227
- name: Build FlyContextMenuHelper
223228
if: ${{ inputs.native == 'Build fresh' }}
@@ -226,7 +231,7 @@ jobs:
226231
msbuild FlyContextMenuHelper.vcxproj `
227232
/p:Configuration=Release `
228233
/p:Platform=${{ matrix.platform }} `
229-
/p:PlatformToolset=v143
234+
/p:PlatformToolset=v145
230235
231236
# -----------------------------------------------------------------------
232237
# Step 3 -- Rust: fly_rust_bridge.dll (RAW decode + SVG render)

0 commit comments

Comments
 (0)