mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
update wix package install (#21537)
This commit is contained in:
@@ -78,19 +78,6 @@ jobs:
|
||||
ob_restore_phase: true # This ensures this done in restore phase to workaround signing issue
|
||||
|
||||
- pwsh: |
|
||||
# cleanup previous install
|
||||
if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) {
|
||||
Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force
|
||||
}
|
||||
$toolsDir = New-Item -ItemType Directory -Path '$(Build.ArtifactStagingDirectory)\tools'
|
||||
$wixUri = 'https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip'
|
||||
|
||||
Invoke-RestMethod -Uri $wixUri -OutFile '$(Build.ArtifactStagingDirectory)\tools\wix.zip' -MaximumRetryCount 5 -RetryIntervalSec 10
|
||||
Import-Module '$(PowerShellRoot)\tools\releaseBuild\Images\microsoft_powershell_windowsservercore\wix.psm1'
|
||||
$isArm64 = '$(Runtime)' -eq 'arm64'
|
||||
|
||||
Install-WixZip -zipPath '$(Build.ArtifactStagingDirectory)\tools\wix.zip' -arm64:$isArm64
|
||||
|
||||
$msixUrl = '$(makeappUrl)'
|
||||
Invoke-RestMethod -Uri $msixUrl -OutFile '$(Pipeline.Workspace)\makeappx.zip'
|
||||
Expand-Archive '$(Pipeline.Workspace)\makeappx.zip' -destination '\' -Force
|
||||
|
||||
+6
-1
@@ -778,7 +778,7 @@ function Restore-PSPackage
|
||||
|
||||
if (-not $ProjectDirs)
|
||||
{
|
||||
$ProjectDirs = @($Options.Top, "$PSScriptRoot/src/TypeCatalogGen", "$PSScriptRoot/src/ResGen", "$PSScriptRoot/src/Modules")
|
||||
$ProjectDirs = @($Options.Top, "$PSScriptRoot/src/TypeCatalogGen", "$PSScriptRoot/src/ResGen", "$PSScriptRoot/src/Modules", "$PSScriptRoot/tools/wix")
|
||||
|
||||
if ($Options.Runtime -like 'fxdependent*') {
|
||||
$ProjectDirs += "$PSScriptRoot/src/Microsoft.PowerShell.GlobalTool.Shim"
|
||||
@@ -2295,6 +2295,11 @@ function Start-PSBootstrap {
|
||||
$psInstallFile = [System.IO.Path]::Combine($PSScriptRoot, "tools", "install-powershell.ps1")
|
||||
& $psInstallFile -AddToPath
|
||||
}
|
||||
if ($Package) {
|
||||
Import-Module '$(PowerShellRoot)\tools\wix\wix.psm1'
|
||||
$isArm64 = '$(Runtime)' -eq 'arm64'
|
||||
Install-Wix -arm64:$isArm64
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
Pop-Location
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\..\PowerShell.Common.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Keep version in sync with wix.psm1 line 18 -->
|
||||
<PackageReference Include="WiX" Version="3.14.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+9
-4
@@ -4,14 +4,19 @@ Import-Module "$PSScriptRoot\dockerInstall.psm1"
|
||||
|
||||
# Install using Wix Zip because the MSI requires an older version of dotnet
|
||||
# which was large and unstable in docker
|
||||
function Install-WixZip
|
||||
function Install-Wix
|
||||
{
|
||||
param($zipPath, $arm64 = $false)
|
||||
param($arm64 = $false)
|
||||
|
||||
$targetRoot = $arm64 ? "${env:ProgramFiles(x86)}\Arm Support WiX Toolset xcopy" : "${env:ProgramFiles(x86)}\WiX Toolset xcopy"
|
||||
# cleanup previous install
|
||||
if(Test-Path $targetRoot) {
|
||||
Remove-Item $targetRoot -Recurse -Force
|
||||
}
|
||||
$binPath = Join-Path -Path $targetRoot -ChildPath 'bin'
|
||||
Write-Verbose "Expanding $zipPath to $binPath ..." -Verbose
|
||||
Expand-Archive -Path $zipPath -DestinationPath $binPath -Force
|
||||
Register-PSRepository -Name NuGetGallery -SourceLocation https://api.nuget.org/v3/index.json
|
||||
# keep version in sync with Microsoft.PowerShell.Packaging.csproj
|
||||
Save-Module -name wix -RequiredVersion 3.14.1 -path "$binPath/"
|
||||
$docExpandPath = Join-Path -Path $binPath -ChildPath 'doc'
|
||||
$sdkExpandPath = Join-Path -Path $binPath -ChildPath 'sdk'
|
||||
$docTargetPath = Join-Path -Path $targetRoot -ChildPath 'doc'
|
||||
Reference in New Issue
Block a user