Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assets/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
<!-- UpgradeCode GUID MUST REMAIN SAME THROUGHOUT ALL VERSIONS, otherwise, updates won't occur. -->
<?if $(sys.BUILDARCH)=x64?>
<?define ExplorerContextMenuDialogText = "&$(var.ProductName) $(env.SimpleProductVersion)"?>
<?define UpgradeCodePreview = "31ab5147-9a97-4452-8443-d9709f0516e1"?>
<?define UpgradeCodeRelease = "39243d76-adaf-42b1-94fb-16ecf83237c8"?>
<?define UpgradeCodePreview = "39243d76-adaf-42b1-94fb-16ecf83237c8"?>
Copy link
Member Author

@TravisEz13 TravisEz13 Jun 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From - https://github.com/PowerShell/PowerShell/pull/12792/files#r445866081

preview upgrade codes

x64 - 39243d76-adaf-42b1-94fb-16ecf83237c8	
x86 - 86abcfbd-1ccc-4a88-b8b2-0facfde29094

release upgrade codes

"UpgradeCodeX64", '31ab5147-9a97-4452-8443-d9709f0516e1', "Process")	
"UpgradeCodeX86", '1d00683b-0f84-4db8-a64f-2f98ad42fe06', "Process")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious where does var.IsPreview declared?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<?define UpgradeCodeRelease = "31ab5147-9a97-4452-8443-d9709f0516e1"?>
<?if $(var.IsPreview)=True?>
<?define UpgradeCode = $(var.UpgradeCodePreview)?>
<?else?>
<?define UpgradeCode = $(var.UpgradeCodeRelease)?>
<?endif?>
<?else?>
<?define ExplorerContextMenuDialogText = "&$(var.ProductName) $(env.SimpleProductVersion) ($(sys.BUILDARCH))"?>
<?define UpgradeCodePreview = "1d00683b-0f84-4db8-a64f-2f98ad42fe06"?>
<?define UpgradeCodeRelease = "86abcfbd-1ccc-4a88-b8b2-0facfde29094"?>
<?define UpgradeCodePreview = "86abcfbd-1ccc-4a88-b8b2-0facfde29094"?>
<?define UpgradeCodeRelease = "1d00683b-0f84-4db8-a64f-2f98ad42fe06"?>
<?if $(var.IsPreview)=True?>
<?define UpgradeCode = $(var.UpgradeCodePreview)?>
<?else?>
Expand Down
28 changes: 28 additions & 0 deletions test/packaging/windows/msi.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@ Describe -Name "Windows MSI" -Fixture {
}
}

Context "Upgrade code" {
BeforeAll {
$previewUpgladeCode = '39243d76-adaf-42b1-94fb-16ecf83237c8'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add tests for Preview why not for Release?

If we add tests for x64 should we skip the tests on x86?

}

It "Preview MSI should not be installed before test" -Skip:(!(Test-Elevated)) {
$result = @(Get-CimInstance -Query "SELECT Value FROM Win32_Property WHERE Property='UpgradeCode' and Value = '{$previewUpgladeCode}'")
$result.Count | Should -Be 0 -Because 'Query should return nothing if preview x64 is not installed'
}

It "MSI should install without error" -Skip:(!(Test-Elevated)) {
{
Invoke-MsiExec -Install -MsiPath $msiX64Path -Properties @{ADD_PATH = 1}
} | Should -Not -Throw
}

It "Upgrade code should be correct" -Skip:(!(Test-Elevated)) {
$result = @(Get-CimInstance -Query "SELECT Value FROM Win32_Property WHERE Property='UpgradeCode' and Value = '{$previewUpgladeCode}'")
$result.Count | Should -Be 1 -Because 'Query should return 1 result if Upgrade code is for x64 preview'
}

It "MSI should uninstall without error" -Skip:(!(Test-Elevated)) {
{
Invoke-MsiExec -Uninstall -MsiPath $msiX64Path
} | Should -Not -Throw
}
}

Context "Add Path disabled" {
It "MSI should install without error" -Skip:(!(Test-Elevated)) {
{
Expand Down