Skip to content

Commit 3b6604f

Browse files
committed
Remove WiX install (PowerShell#16834)
# Conflicts: # tools/releaseBuild/azureDevOps/templates/windows-packaging.yml
1 parent 8b83303 commit 3b6604f

File tree

2 files changed

+24
-43
lines changed

2 files changed

+24
-43
lines changed

tools/releaseBuild/azureDevOps/releasePipeline.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ stages:
143143
- deployment: AzureBlobPublic
144144
displayName: Make Azure Blob Public
145145

146-
pool: PowerShell1ES
146+
pool:
147+
name: PowerShell1ES
147148
demands:
148149
- ImageOverride -equals PSMMS2019-Secure
149150

tools/releaseBuild/azureDevOps/templates/windows-packaging.yml

Lines changed: 22 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ parameters:
99
default: ''
1010

1111
jobs:
12-
- job: sign_windows_${{ parameters.Architecture }}
13-
displayName: Package Windows - ${{ parameters.Architecture }}
12+
- job: sign_windows_${{ parameters.Architecture }}_${{ parameters.BuildConfiguration }}
13+
displayName: Package Windows - ${{ parameters.Architecture }} ${{ parameters.BuildConfiguration }}
1414
condition: succeeded()
1515
dependsOn: ${{ parameters.parentJob }}
1616
pool:
@@ -36,18 +36,14 @@ jobs:
3636
- checkout: ComplianceRepo
3737
clean: true
3838

39-
- template: shouldSign.yml
4039
- template: SetVersionVariables.yml
4140
parameters:
4241
ReleaseTagVar: $(ReleaseTagVar)
4342

44-
- powershell: |
45-
$pkgFilter = if ( '$(Architecture)' -eq 'arm' ) {
46-
"arm32"
47-
}
48-
else {
49-
'$(Architecture)'
50-
}
43+
- template: shouldSign.yml
44+
45+
- pwsh: |
46+
$pkgFilter = if ( '$(Architecture)' -eq 'arm' ) { "arm32" } else { '$(Architecture)' }
5147
5248
$vstsCommandString = "vso[task.setvariable variable=PkgFilter]$pkgFilter"
5349
Write-Host ("sending " + $vstsCommandString)
@@ -63,27 +59,16 @@ jobs:
6359
- template: cloneToOfficialPath.yml
6460

6561
- pwsh: |
66-
# cleanup previous install
67-
if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) {
68-
Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force
62+
$zipPathString = '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
63+
Write-Verbose -Verbose "Zip Path: $zipPathString"
64+
$zipPath = Get-Item $zipPathString
65+
if(@($zipPath).Count -eq 0) {
66+
throw "No files found at '$zipPathString'"
67+
}
68+
elseif(@($zipPath).Count -ne 1) {
69+
$names = $zipPath.Name -join "', '"
70+
throw "multiple files '${names}' found with '${zipPathString}'"
6971
}
70-
71-
$toolsDir = New-Item -ItemType Directory -Path '$(Build.ArtifactStagingDirectory)\tools'
72-
$wixUri = 'https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip'
73-
Invoke-RestMethod -Uri $wixUri -OutFile '$(Build.ArtifactStagingDirectory)\tools\wix.zip' -MaximumRetryCount 5 -RetryIntervalSec 10
74-
75-
Import-Module '$(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1'
76-
Install-WixZip -zipPath '$(Build.ArtifactStagingDirectory)\tools\wix.zip'
77-
78-
$msixUrl = '$(makeappUrl)'
79-
Invoke-RestMethod -Uri $msixUrl -OutFile '\makeappx.zip'
80-
Expand-Archive '\makeappx.zip' -destination '\' -Force
81-
82-
displayName: Install packaging tools
83-
84-
- powershell: |
85-
$zipPath = Get-Item '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
86-
Write-Verbose -Verbose "Zip Path: $zipPath"
8772
8873
$expandedFolder = $zipPath.BaseName
8974
Write-Host "sending.. vso[task.setvariable variable=SymbolsFolder]$expandedFolder"
@@ -202,13 +187,14 @@ jobs:
202187
**\*.dll
203188
useMinimatch: true
204189
shouldSign: $(SHOULD_SIGN)
190+
displayName: Sign ThirdParty binaries
205191

206-
- powershell: |
192+
- pwsh: |
207193
Get-ChildItem '$(System.ArtifactsDirectory)\thirdPartySigned\*'
208194
displayName: Captrue ThirdParty Signed files
209195
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true'))
210196
211-
- powershell: |
197+
- pwsh: |
212198
Import-Module $(PowerShellRoot)/build.psm1 -Force
213199
Import-Module $(PowerShellRoot)/tools/packaging -Force
214200
$signedFilesPath = '$(System.ArtifactsDirectory)\thirdPartySigned'
@@ -226,7 +212,7 @@ jobs:
226212
PackageVersion: $(Version)
227213
sourceScanPath: '$(PowerShellRoot)\tools'
228214

229-
- powershell: |
215+
- pwsh: |
230216
Import-Module $(PowerShellRoot)/build.psm1 -Force
231217
Import-Module $(PowerShellRoot)/tools/packaging -Force
232218
@@ -245,7 +231,7 @@ jobs:
245231
Write-Host "##$vstsCommandString"
246232
displayName: Compress signed files
247233
248-
- powershell: |
234+
- pwsh: |
249235
$runtime = switch ($env:Architecture)
250236
{
251237
"x64" { "win7-x64" }
@@ -257,13 +243,12 @@ jobs:
257243
}
258244
259245
$signedPkg = "$(BuildPackagePath)"
260-
261246
Write-Verbose -Verbose -Message "signedPkg = $signedPkg"
262247
263248
$(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -BuildZip $signedPkg -location '$(PowerShellRoot)' -destination '$(System.ArtifactsDirectory)\pkgSigned' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)'
264249
displayName: 'Build Windows Universal - $(Architecture) Package'
265250
266-
- powershell: |
251+
- pwsh: |
267252
Get-ChildItem '$(System.ArtifactsDirectory)\pkgSigned' | ForEach-Object {
268253
$packagePath = $_.FullName
269254
Write-Host "Uploading $packagePath"
@@ -277,17 +262,12 @@ jobs:
277262
sourceScanPath: '$(PowerShellRoot)\tools'
278263
snapshotForceEnabled: true
279264

280-
- powershell: |
265+
- pwsh: |
281266
if ((Test-Path "\PowerShell")) {
282267
Remove-Item -Path "\PowerShell" -Force -Recurse -Verbose
283268
}
284269
else {
285270
Write-Verbose -Verbose -Message "No cleanup required."
286271
}
287-
288-
if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) {
289-
Write-Verbose -Verbose "Cleaning up Wix tools"
290-
Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force
291-
}
292272
displayName: Clean up local Clone
293273
condition: always()

0 commit comments

Comments
 (0)