@@ -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)
0 commit comments