mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-27 03:46:23 +08:00
Update installation on Wix module (#23808)
This commit is contained in:
parent
d4327d29e1
commit
423c4c17a6
@ -36,11 +36,37 @@ function Install-Wix
|
||||
}
|
||||
$binPath = Join-Path -Path $targetRoot -ChildPath 'bin'
|
||||
|
||||
Register-PSRepository -Name 'dotnet-eng' -SourceLocation "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json"
|
||||
$psresourceGet = Get-Module -ListAvailable -Name 'Microsoft.PowerShell.PSResourceGet' -ErrorAction SilentlyContinue
|
||||
|
||||
if (-not $psresourceGet) {
|
||||
Install-Module -Name 'Microsoft.PowerShell.PSResourceGet' -Force -AllowClobber -Scope CurrentUser
|
||||
}
|
||||
|
||||
$respository = Get-PSResourceRepository -Name 'dotnet-eng' -ErrorAction SilentlyContinue
|
||||
|
||||
if (-not $respository) {
|
||||
Write-Verbose -Verbose "Registering dotnet-eng repository..."
|
||||
Register-PSResourceRepository -Name 'dotnet-eng' -Uri 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' -Trusted
|
||||
}
|
||||
|
||||
# keep version in sync with Microsoft.PowerShell.Packaging.csproj
|
||||
Save-Module -name Microsoft.Signed.Wix -RequiredVersion '3.14.1-8722.20240403.1' -path "$binPath/"
|
||||
$docExpandPath = Join-Path -Path $binPath -ChildPath 'doc'
|
||||
$sdkExpandPath = Join-Path -Path $binPath -ChildPath 'sdk'
|
||||
|
||||
if (-not (Test-Path $binPath)) {
|
||||
$null = New-Item -ItemType Directory -Path $binPath
|
||||
Write-Verbose -Verbose "Created bin directory for WIX at $binPath"
|
||||
}
|
||||
|
||||
try {
|
||||
Save-PSResource -Name 'Microsoft.Signed.Wix' -Repository 'dotnet-eng' -path "$binPath/" -Prerelease
|
||||
}
|
||||
finally {
|
||||
Write-Verbose -Verbose "Unregistering dotnet-eng repository..."
|
||||
Unregister-PSResourceRepository -Name 'dotnet-eng'
|
||||
}
|
||||
|
||||
$docExpandPath = Join-Path -Path "$binPath\Microsoft.Signed.Wix\3.14.1\tools\" -ChildPath 'doc'
|
||||
$sdkExpandPath = Join-Path -Path "$binPath\Microsoft.Signed.Wix\3.14.1\tools\" -ChildPath 'sdk'
|
||||
$x86ExpandPath = Join-Path -Path "$binPath\Microsoft.Signed.Wix\3.14.1\tools\" -ChildPath 'x86'
|
||||
|
||||
$docTargetPath = Join-Path -Path $targetRoot -ChildPath 'doc'
|
||||
|
||||
@ -73,7 +99,7 @@ function Install-Wix
|
||||
Write-Verbose "Fixing folder structure ..." -Verbose
|
||||
Copy-Item -Path $docExpandPath -Destination $docTargetPath -Force
|
||||
Copy-Item -Path $sdkExpandPath -Destination $sdkTargetPath -Force
|
||||
Copy-Item -Path "$binPath\wix\3.14.1\tools\*" -Destination $binTargetPath -Force
|
||||
Copy-Item -Path "$binPath\Microsoft.Signed.Wix\3.14.1\tools\*" -Destination $binTargetPath -Force
|
||||
Copy-Item -Path $x86ExpandPath -Destination $x86TargetPath -Force -Recurse -Verbose
|
||||
Copy-Item -Path "$x86ExpandPath\burn.exe" -Destination "$x86TargetPath\burn.exe" -Force -Verbose
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user