diff --git a/assets/wix/Product.wxs b/assets/wix/Product.wxs index b2cb57dbdd2..0b525288ae1 100644 --- a/assets/wix/Product.wxs +++ b/assets/wix/Product.wxs @@ -44,6 +44,12 @@ + + + + + + + + + + + + + + + + not INSTALLFOLDER and PREVIOUS_INSTALLFOLDER + + + + + + + + not ADD_PATH and PREVIOUS_ADD_PATH + + + not ADD_PATH + + + ADD_PATH<>1 + + + not ADD_PATH + + + + + + + + not REGISTER_MANIFEST and PREVIOUS_REGISTER_MANIFEST + + + not REGISTER_MANIFEST + + + REGISTER_MANIFEST<>1 + + + not REGISTER_MANIFEST + + + + + + + + not ENABLE_PSREMOTING and PREVIOUS_ENABLE_PSREMOTING + + + ENABLE_PSREMOTING<>1 + + + not ENABLE_PSREMOTING + + + + + + + + not DISABLE_TELEMETRY and PREVIOUS_DISABLE_TELEMETRY + + + DISABLE_TELEMETRY<>1 + + + not DISABLE_TELEMETRY + + + + + + + + not ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL and PREVIOUS_ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL + + + ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL<>1 + + + not ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL + + + + + + + + not ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL and PREVIOUS_ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL + + + ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL<>1 + + + not ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL + + + + + + + + not USE_MU and PREVIOUS_USE_MU + + + not USE_MU + + + USE_MU<>1 + + + not USE_MU + + + + + + + + not ENABLE_MU and PREVIOUS_ENABLE_MU + + + not ENABLE_MU + + + ENABLE_MU<>1 + + + not ENABLE_MU + + + + + @@ -230,7 +403,7 @@ - DISABLE_TELEMETRY + DISABLE_TELEMETRY=1 @@ -245,7 +418,7 @@ - ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL + ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 @@ -295,7 +468,7 @@ - ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL + ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 @@ -305,6 +478,17 @@ + + + + + + + + + + + @@ -328,8 +512,6 @@ - - @@ -337,12 +519,12 @@ - - - - - - + + + + + + The application is distributed under the MIT license.]]> @@ -363,8 +545,6 @@ - - diff --git a/test/packaging/windows/msi.tests.ps1 b/test/packaging/windows/msi.tests.ps1 index 93a56821003..14dc40a6ff2 100644 --- a/test/packaging/windows/msi.tests.ps1 +++ b/test/packaging/windows/msi.tests.ps1 @@ -115,6 +115,27 @@ Describe -Name "Windows MSI" -Fixture { $runtime = $env:PSMsiRuntime $muEnabled = Test-IsMuEnabled + if ($runtime -like '*x86*') { + $propertiesRegKeyParent = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\PowerShellCore" + } else { + $propertiesRegKeyParent = "HKLM:\SOFTWARE\Microsoft\PowerShellCore" + } + + if ($channel -eq "preview") { + $propertiesRegKeyName = "PreviewInstallerProperties" + } else { + $propertiesRegKeyName = "InstallerProperties" + } + + # Rename the registry key that contains the saved installer + # properties so that the tests don't overwrite them. + $propertiesRegKeyPath = Join-Path -Path $propertiesRegKeyParent -ChildPath $propertiesRegKeyName + $propertiesBackupRegKeyName = "BackupInstallerProperties" + $propertiesBackupRegKeyPath = Join-Path -Path $propertiesRegKeyParent -ChildPath $propertiesBackupRegKeyName + if (Test-Path -Path $propertiesRegKeyPath) { + Rename-Item -Path $propertiesRegKeyPath -NewName $propertiesBackupRegKeyName + } + # Get any existing powershell in the path $beforePath = @(([System.Environment]::GetEnvironmentVariable('PATH', 'MACHINE')) -split ';' | Where-Object {$_ -like '*files\powershell*'}) @@ -133,10 +154,17 @@ Describe -Name "Windows MSI" -Fixture { AfterAll { Set-StrictMode -Version 3.0 + + # Restore the original saved installer properties registry key. + Remove-Item -Path $propertiesRegKeyPath -ErrorAction SilentlyContinue + if (Test-Path -Path $propertiesBackupRegKeyPath) { + Rename-Item -Path $propertiesBackupRegKeyPath -NewName $propertiesRegKeyName + } } BeforeEach { $error.Clear() + Remove-Item -Path $propertiesRegKeyPath -ErrorAction SilentlyContinue } Context "Upgrade code" {