Skip to content

utils: update WiX and fetch if packaging #75929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2024
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
23 changes: 14 additions & 9 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.e
$VSInstallRoot = & $vswhere -nologo -latest -products "*" -all -prerelease -property installationPath
$msbuild = "$VSInstallRoot\MSBuild\Current\Bin\$BuildArchName\MSBuild.exe"

# Hoist to global scope as this is used in two sites.
$WiXVersion = "4.0.5"

# Avoid $env:ProgramFiles in case this script is running as x86
$UnixToolsBinDir = "$env:SystemDrive\Program Files\Git\usr\bin"

Expand Down Expand Up @@ -621,7 +624,8 @@ function Fetch-Dependencies {
}

function Extract-ZipFile {
param (
param
(
[string]$ZipFileName,
[string]$BinaryCache,
[string]$ExtractPath
Expand All @@ -647,7 +651,8 @@ function Fetch-Dependencies {
}

function Extract-Toolchain {
param (
param
(
[string]$InstallerExeName,
[string]$BinaryCache,
[string]$ToolchainName
Expand Down Expand Up @@ -678,13 +683,15 @@ function Fetch-Dependencies {
}
}

$WiXVersion = "4.0.4"
if ($SkipBuild -and $SkipPackaging) { return }

$WiXURL = "https://www.nuget.org/api/v2/package/wix/$WiXVersion"
$WiXHash = "A9CA12214E61BB49430A8C6E5E48AC5AE6F27DC82573B5306955C4D35F2D34E2"
$WiXHash = "DF9BDB347183716F82EFE2CECB8C54BB3554AA907A69F47A41741D6FA4D0A754"
DownloadAndVerify $WixURL "$BinaryCache\WiX-$WiXVersion.zip" $WiXHash

Extract-ZipFile WiX-$WiXVersion.zip $BinaryCache WiX-$WiXVersion

if ($SkipBuild) { return }

DownloadAndVerify $PinnedBuild "$BinaryCache\$PinnedToolchain.exe" $PinnedSHA256

# TODO(compnerd) stamp/validate that we need to re-extract
Expand Down Expand Up @@ -2376,15 +2383,13 @@ function Stage-BuildArtifacts($Arch) {
} else {
New-Item -Type Directory -Path "$($Arch.BinaryCache)\installer\$($Arch.VSName)\" -ErrorAction Ignore | Out-Null
}
Invoke-Program "$BinaryCache\wix-4.0.4\tools\net6.0\any\wix.exe" -- burn detach "$($Arch.BinaryCache)\installer\Release\$($Arch.VSName)\installer.exe" -engine "$Stage\installer-engine.exe" -intermediateFolder "$($Arch.BinaryCache)\installer\$($Arch.VSName)\"
Invoke-Program "$BinaryCache\wix-$WiXVersion\tools\net6.0\any\wix.exe" -- burn detach "$($Arch.BinaryCache)\installer\Release\$($Arch.VSName)\installer.exe" -engine "$Stage\installer-engine.exe" -intermediateFolder "$($Arch.BinaryCache)\installer\$($Arch.VSName)\"
}

#-------------------------------------------------------------------
try {

if (-not $SkipBuild) {
Fetch-Dependencies
}
Fetch-Dependencies

if (-not $SkipBuild) {
Invoke-BuildStep Build-CMark $BuildArch
Expand Down