Skip to content

Commit 93f9db6

Browse files
authored
utils: Hoist WiX artifact definition. (#79953)
* utils: Hoist WiX artifact definition. * Fix merge damage from rebase.
1 parent 4cc6411 commit 93f9db6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

utils/build.ps1

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.e
206206
$VSInstallRoot = & $vswhere -nologo -latest -products "*" -all -prerelease -property installationPath
207207
$msbuild = "$VSInstallRoot\MSBuild\Current\Bin\$BuildArchName\MSBuild.exe"
208208

209-
# Hoist to global scope as this is used in two sites.
210-
$WiXVersion = "4.0.6"
211-
212209
# Avoid $env:ProgramFiles in case this script is running as x86
213210
$UnixToolsBinDir = "$env:SystemDrive\Program Files\Git\usr\bin"
214211

@@ -332,6 +329,13 @@ $BuildArch = switch ($BuildArchName) {
332329
default { throw "Unsupported processor architecture" }
333330
}
334331

332+
$WiX = @{
333+
Version = "4.0.6";
334+
URL = "https://www.nuget.org/api/v2/package/wix/4.0.6";
335+
SHA256 = "A94DD42AE1FB56B32DA180E2173CEDA4F0D10B4C8871C5EE59ECB502131A1EB6";
336+
Path = [IO.Path]::Combine("$BinaryCache\WiX-4.0.6", "tools", "net6.0", "any");
337+
}
338+
335339
$KnownPythons = @{
336340
"3.9.10" = @{
337341
AMD64 = @{
@@ -381,7 +385,6 @@ $KnownNDKs = @{
381385
}
382386
}
383387

384-
385388
$IsCrossCompiling = $HostArchName -ne $BuildArchName
386389

387390
$TimingData = New-Object System.Collections.Generic.List[System.Object]
@@ -811,7 +814,7 @@ function Get-Dependencies {
811814

812815
# The new runtime MSI is built to expand files into the immediate directory. So, setup the installation location.
813816
New-Item -ItemType Directory -ErrorAction Ignore $BinaryCache\toolchains\$PinnedToolchain\LocalApp\Programs\Swift\Runtimes\$(Get-PinnedToolchainVersion)\usr\bin | Out-Null
814-
Invoke-Program $BinaryCache\WiX-$WiXVersion\tools\net6.0\any\wix.exe -- burn extract $BinaryCache\$InstallerExeName -out $BinaryCache\toolchains\ -outba $BinaryCache\toolchains\
817+
Invoke-Program "$($WiX.Path)\wix.exe" -- burn extract $BinaryCache\$InstallerExeName -out $BinaryCache\toolchains\ -outba $BinaryCache\toolchains\
815818
Get-ChildItem "$BinaryCache\toolchains\WixAttachedContainer" -Filter "*.msi" | ForEach-Object {
816819
$LogFile = [System.IO.Path]::ChangeExtension($_.Name, "log")
817820
$TARGETDIR = if ($_.Name -eq "rtl.msi") { "$BinaryCache\toolchains\$ToolchainName\LocalApp\Programs\Swift\Runtimes\$(Get-PinnedToolchainVersion)\usr\bin" } else { "$BinaryCache\toolchains\$ToolchainName" }
@@ -826,10 +829,8 @@ function Get-Dependencies {
826829
Write-Host -ForegroundColor Cyan "[$([DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss"))] Get-Dependencies..."
827830
}
828831

829-
$WiXURL = "https://www.nuget.org/api/v2/package/wix/$WiXVersion"
830-
$WiXHash = "A94DD42AE1FB56B32DA180E2173CEDA4F0D10B4C8871C5EE59ECB502131A1EB6"
831-
DownloadAndVerify $WixURL "$BinaryCache\WiX-$WiXVersion.zip" $WiXHash
832-
Expand-ZipFile WiX-$WiXVersion.zip $BinaryCache WiX-$WiXVersion
832+
DownloadAndVerify $WiX.URL "$BinaryCache\WiX-$($WiX.Version).zip" $WiX.SHA256
833+
Expand-ZipFile WiX-$($WiX.Version).zip $BinaryCache WiX-$($WiX.Version)
833834

834835
if ($SkipBuild) { return }
835836

@@ -3135,7 +3136,7 @@ function Copy-BuildArtifactsToStage($Arch) {
31353136
} else {
31363137
New-Item -Type Directory -Path "$BinaryCache\$($Arch.LLVMTarget)\installer\$($Arch.VSName)" -ErrorAction Ignore | Out-Null
31373138
}
3138-
Invoke-Program "$BinaryCache\wix-$WiXVersion\tools\net6.0\any\wix.exe" -- burn detach "$BinaryCache\$($Arch.LLVMTarget)\installer\Release\$($Arch.VSName)\installer.exe" -engine "$Stage\installer-engine.exe" -intermediateFolder "$BinaryCache\$($Arch.LLVMTarget)\installer\$($Arch.VSName)\"
3139+
Invoke-Program "$($WiX.Path)\wix.exe" -- burn detach "$BinaryCache\$($Arch.LLVMTarget)\installer\Release\$($Arch.VSName)\installer.exe" -engine "$Stage\installer-engine.exe" -intermediateFolder "$BinaryCache\$($Arch.LLVMTarget)\installer\$($Arch.VSName)\"
31393140
}
31403141

31413142
#-------------------------------------------------------------------

0 commit comments

Comments
 (0)