PowerToys/.pipelines/installWiX.ps1
Jaime Bernardo 07f3507f11
[ci]Fix dead links for WiX 3 binaries (#23367)
* [ci]Fix dead links on WiX 3 binaries
2023-01-16 13:19:36 +00:00

26 lines
1.3 KiB
PowerShell

$ProgressPreference = 'SilentlyContinue'
$WixDownloadUrl = "https://github.com/JaneaSystems/wix3/releases/download/wix3-3.14.0.6526/wix314.exe"
$WixBinariesDownloadUrl = "https://github.com/JaneaSystems/wix3/releases/download/wix3-3.14.0.6526/wix314-binaries.zip"
# Download WiX binaries and verify their hash sums
Invoke-WebRequest -Uri $WixDownloadUrl -OutFile "$($ENV:Temp)\wix314.exe"
$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\wix314.exe").Hash
if ($Hash -ne 'FADEB00B1FCCD9BB2FDD6CE28D4C3ECDA339C8906A72586515C14A93CEADB6FE')
{
Write-Error "$WixHash"
throw "wix314.exe has unexpected SHA256 hash: $Hash"
}
Invoke-WebRequest -Uri $WixBinariesDownloadUrl -OutFile "$($ENV:Temp)\wix314-binaries.zip"
$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\wix314-binaries.zip").Hash
if($Hash -ne '4C89898DF3BCAB13E12F7CA54399C35AD273475AD2CB6284611D00AE2D063C2C')
{
throw "wix314-binaries.zip has unexpected SHA256 hash: $Hash"
}
# Install WiX
Start-Process -Wait -FilePath "$($ENV:Temp)\wix314.exe" -ArgumentList "/install /quiet"
# Extract WiX binaries and copy wix.targets to the installed dir
Expand-Archive -Path "$($ENV:Temp)\wix314-binaries.zip" -Force -DestinationPath "$($ENV:Temp)"
Copy-Item -Path "$($ENV:Temp)\wix.targets" -Destination "C:\Program Files (x86)\WiX Toolset v3.14\"