From d7370cfa44153a519c28b0401d3a93d1d4aced9a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 12 Feb 2021 15:07:42 -0800 Subject: [PATCH] Refactor MSI CI (#14753) --- .vsts-ci/windows/windows-packaging.yml | 65 +++++++++--------- assets/{ => wix}/Product.wxs | 6 +- assets/{ => wix}/WixUIBannerBmp.png | Bin assets/{ => wix}/WixUIDialogBmp.png | Bin assets/{ => wix}/WixUIInfoIco.png | Bin assets/{ => wix}/files.wxs | 0 assets/{ => wix}/patch-template.wxs | 0 .../Installer/WindowsInstaller.Tests.ps1 | 2 +- tools/packaging/packaging.psm1 | 10 +-- 9 files changed, 43 insertions(+), 40 deletions(-) rename assets/{ => wix}/Product.wxs (99%) rename assets/{ => wix}/WixUIBannerBmp.png (100%) rename assets/{ => wix}/WixUIDialogBmp.png (100%) rename assets/{ => wix}/WixUIInfoIco.png (100%) rename assets/{ => wix}/files.wxs (100%) rename assets/{ => wix}/patch-template.wxs (100%) diff --git a/.vsts-ci/windows/windows-packaging.yml b/.vsts-ci/windows/windows-packaging.yml index e3edb42d4c..f471196d96 100644 --- a/.vsts-ci/windows/windows-packaging.yml +++ b/.vsts-ci/windows/windows-packaging.yml @@ -8,14 +8,17 @@ trigger: - release* - feature* paths: - include: - - /.vsts-ci/templates/windows-packaging.yml - - /.vsts-ci/windows-packaging.yml - - /global.json - - /src/* - - /tools/ci.psm1 - - /tools/packaging/* - - /assets/* + exclude: + - tests/* + - docs/* + - demos/* + - CHANGELOG/* + - .devcontainer/* + - .github/* + - .poshchan/* + - .vscode/* + - code-server/* + - docker/* pr: branches: @@ -27,29 +30,29 @@ pr: # file extension filters are not supported when this was written. # This really should be /src/**/*.csproj include: - - /.vsts-ci/templates/windows-packaging.yml - - /.vsts-ci/windows-packaging.yml - - /global.json - - /src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj - - /src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj - - /src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj - - /src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj - - /src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj - - /src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj - - /src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj - - /src/Microsoft.PowerShell.GlobalTool.Shim/Microsoft.PowerShell.GlobalTool.Shim.csproj - - /src/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.csproj - - /src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj - - /src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj - - /src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj - - /src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj - - /src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj - - /src/Modules/PSGalleryModules.csproj - - /src/powershell-win-core/powershell-win-core.csproj - - /tools/ci.psm1 - - /tools/packaging/* - - /assets/files.wxs - - /assets/Product.wxs + - .vsts-ci/windows/* + - assets/wix/* + - build.psm1 + - global.json + - nuget.config + - PowerShell.Common.props + - src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj + - src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj + - src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj + - src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj + - src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj + - src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj + - src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj + - src/Microsoft.PowerShell.GlobalTool.Shim/Microsoft.PowerShell.GlobalTool.Shim.csproj + - src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj + - src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj + - src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj + - src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj + - src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj + - src/Modules/PSGalleryModules.csproj + - src/powershell-win-core/powershell-win-core.csproj + - tools/ci.psm1 + - tools/packaging/* variables: - name: GIT_CONFIG_PARAMETERS diff --git a/assets/Product.wxs b/assets/wix/Product.wxs similarity index 99% rename from assets/Product.wxs rename to assets/wix/Product.wxs index a0ab069270..b4a69fa8e2 100644 --- a/assets/Product.wxs +++ b/assets/wix/Product.wxs @@ -53,9 +53,9 @@ - - - + + + diff --git a/assets/WixUIBannerBmp.png b/assets/wix/WixUIBannerBmp.png similarity index 100% rename from assets/WixUIBannerBmp.png rename to assets/wix/WixUIBannerBmp.png diff --git a/assets/WixUIDialogBmp.png b/assets/wix/WixUIDialogBmp.png similarity index 100% rename from assets/WixUIDialogBmp.png rename to assets/wix/WixUIDialogBmp.png diff --git a/assets/WixUIInfoIco.png b/assets/wix/WixUIInfoIco.png similarity index 100% rename from assets/WixUIInfoIco.png rename to assets/wix/WixUIInfoIco.png diff --git a/assets/files.wxs b/assets/wix/files.wxs similarity index 100% rename from assets/files.wxs rename to assets/wix/files.wxs diff --git a/assets/patch-template.wxs b/assets/wix/patch-template.wxs similarity index 100% rename from assets/patch-template.wxs rename to assets/wix/patch-template.wxs diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index 76cca8151d..66bd08e74f 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -14,7 +14,7 @@ Describe "Windows Installer" -Tags "Scenario" { } It "WiX (Windows Installer XML) file contains pre-requisites link $preRequisitesLink" -Skip:$skipTest { - $wixProductFile = Join-Path -Path $PSScriptRoot -ChildPath "..\..\..\assets\Product.wxs" + $wixProductFile = Join-Path -Path $PSScriptRoot -ChildPath "..\..\..\assets\wix\Product.wxs" (Get-Content $wixProductFile -Raw).Contains($preRequisitesLink) | Should -BeTrue } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 0b80193053..f2733e2068 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -2844,7 +2844,7 @@ function New-MSIPatch [Parameter(HelpMessage='Path to the patch template WXS. Usually you do not need to specify this')] [ValidateNotNullOrEmpty()] [ValidateScript( {Test-Path $_})] - [string] $PatchWxsPath = "$RepoRoot\assets\patch-template.wxs", + [string] $PatchWxsPath = "$RepoRoot\assets\wix\patch-template.wxs", [Parameter(HelpMessage='Produce a delta patch instead of a full patch. Usually not worth it.')] [switch] $Delta @@ -2884,7 +2884,7 @@ function New-MSIPatch Copy-Item -Path $BaselineWixPdbPath -Destination $wixBaselineOriginalPdbPath -Force Copy-Item -Path $PatchWixPdbPath -Destination $wixPatchOriginalPdbPath -Force - [xml] $filesAssetXml = Get-Content -Raw -Path "$RepoRoot\assets\files.wxs" + [xml] $filesAssetXml = Get-Content -Raw -Path "$RepoRoot\assets\wix\files.wxs" [xml] $patchTemplateXml = Get-Content -Raw -Path $PatchWxsPath # Update the patch version @@ -2975,12 +2975,12 @@ function New-MSIPackage # File describing the MSI Package creation semantics [ValidateNotNullOrEmpty()] [ValidateScript( {Test-Path $_})] - [string] $ProductWxsPath = "$RepoRoot\assets\Product.wxs", + [string] $ProductWxsPath = "$RepoRoot\assets\wix\Product.wxs", # File describing the MSI file components [ValidateNotNullOrEmpty()] [ValidateScript( {Test-Path $_})] - [string] $FilesWxsPath = "$RepoRoot\assets\Files.wxs", + [string] $FilesWxsPath = "$RepoRoot\assets\wix\Files.wxs", # Path to Assets folder containing artifacts such as icons, images [ValidateNotNullOrEmpty()] @@ -3331,7 +3331,7 @@ function Test-FileWxs # File describing the MSI file components from the asset folder [ValidateNotNullOrEmpty()] [ValidateScript( {Test-Path $_})] - [string] $FilesWxsPath = "$RepoRoot\assets\Files.wxs", + [string] $FilesWxsPath = "$RepoRoot\assets\wix\Files.wxs", # File describing the MSI file components generated by heat [ValidateNotNullOrEmpty()]