Skip to content
This repository was archived by the owner on Aug 1, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions scripts/build_installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,30 @@ if (-not (Test-Path (Join-Path $engineOut "flywheel-gateway.exe"))) {
}

# 3. VC++ CRT from a Redist tree (redistributable copies, never System32).
# Discovery is vswhere-first: VS installs move roots across major versions
# (2022 lives under \2022\, VS 18 under \18\), and hardcoding a year broke
# the first CI release run. vswhere is shipped with every VS install and on
# every GitHub runner image; a broad directory glob stays as the fallback.
$crtDir = Join-Path $repo "build\crt"
New-Item -ItemType Directory -Force $crtDir | Out-Null
$redistRoots = @(
"C:\Program Files\Microsoft Visual Studio\2022",
"C:\Program Files (x86)\Microsoft Visual Studio\2022"
) | Where-Object { Test-Path $_ }
$crtSource = $redistRoots |
ForEach-Object { Get-ChildItem -Path $_ -Recurse -Directory -Filter "Microsoft.VC14*.CRT" -ErrorAction SilentlyContinue } |
Where-Object { $_.FullName -match '\\x64\\' } |
Select-Object -First 1
if (-not $crtSource) { throw "no VC14x x64 CRT Redist tree found under VS 2022" }
$vsRoots = @()
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (Test-Path $vswhere) {
$vsRoots += & $vswhere -latest -products * -property installationPath 2>$null
$vsRoots += & $vswhere -products * -property installationPath 2>$null
}
$vsRoots += Get-ChildItem -Directory -ErrorAction SilentlyContinue `
"C:\Program Files\Microsoft Visual Studio\*\*",
"C:\Program Files (x86)\Microsoft Visual Studio\*\*" |
Select-Object -ExpandProperty FullName
$crtSource = $vsRoots | Where-Object { $_ } | Select-Object -Unique |
ForEach-Object {
Get-ChildItem -Directory -ErrorAction SilentlyContinue `
(Join-Path $_ "VC\Redist\MSVC\*\x64\Microsoft.VC14*.CRT")
} | Select-Object -First 1
if (-not $crtSource) {
throw "no VC14x x64 CRT Redist tree found (searched: $($vsRoots -join '; '))"
}
foreach ($dll in "msvcp140.dll", "vcruntime140.dll", "vcruntime140_1.dll") {
Copy-Item (Join-Path $crtSource.FullName $dll) $crtDir -Force
}
Expand Down
Loading