| ... | @@ -1707,23 +1707,21 @@ export const preflightMacDesktopBuild = Effect.fn("preflightMacDesktopBuild")(fu | ... | @@ -1707,23 +1707,21 @@ export const preflightMacDesktopBuild = Effect.fn("preflightMacDesktopBuild")(fu |
| 1707 | }); | 1707 | }); |
| 1708 | | 1708 | |
| 1709 | function windowsVswherePrerequisiteScript(arch: typeof BuildArch.Type): string { | 1709 | function windowsVswherePrerequisiteScript(arch: typeof BuildArch.Type): string { |
| 1710 | const components = | 1710 | const toolComponents = |
| 1711 | arch === "arm64" | 1711 | arch === "arm64" |
| 1712 | ? [ | 1712 | ? ["Microsoft.VisualStudio.Component.VC.Tools.ARM64"] |
| 1713 | "Microsoft.VisualStudio.Component.VC.Tools.ARM64", | 1713 | : ["Microsoft.VisualStudio.Component.VC.Tools.x86.x64"]; |
| 1714 | "Microsoft.VisualStudio.Component.VC.Tools.ARM64.Spectre", | 1714 | const spectreArch = arch === "arm64" ? "arm64" : "x64"; |
| 1715 | ] | | |
| 1716 | : [ | | |
| 1717 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", | | |
| 1718 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre", | | |
| 1719 | ]; | | |
| 1720 | return [ | 1715 | return [ |
| 1721 | "$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\\Installer\\vswhere.exe'", | 1716 | "$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\\Installer\\vswhere.exe'", |
| 1722 | "if (!(Test-Path $vswhere)) { exit 1 }", | 1717 | "if (!(Test-Path $vswhere)) { exit 1 }", |
| 1723 | `$install = & $vswhere -latest -products * -requires ${components.join(" ")} -property installationPath`, | 1718 | `$install = & $vswhere -latest -products * -requires ${toolComponents.join(" ")} -property installationPath`, |
| 1724 | "if (!$install) { exit 1 }", | 1719 | "if (!$install) { exit 1 }", |
| 1725 | "$kitsRoot = Get-ItemPropertyValue 'HKLM:\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots' -Name KitsRoot10 -ErrorAction SilentlyContinue", | 1720 | "$kitsRoot = Get-ItemPropertyValue 'HKLM:\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots' -Name KitsRoot10 -ErrorAction SilentlyContinue", |
| 1726 | "if (!$kitsRoot -or !(Test-Path (Join-Path $kitsRoot 'Lib'))) { exit 1 }", | 1721 | "if (!$kitsRoot -or !(Test-Path (Join-Path $kitsRoot 'Lib'))) { exit 1 }", |
| | 1722 | "$msvcToolset = Get-ChildItem (Join-Path $install 'VC\\Tools\\MSVC') -Directory | Sort-Object { [version]$_.Name } -Descending | Select-Object -First 1", |
| | 1723 | "if (!$msvcToolset) { exit 1 }", |
| | 1724 | `if (!(Test-Path (Join-Path $msvcToolset.FullName 'lib\\spectre\\${spectreArch}'))) { exit 1 }`, |
| 1727 | ].join("; "); | 1725 | ].join("; "); |
| 1728 | } | 1726 | } |
| 1729 | | 1727 | |