diff --git a/contrib/cirrus/win-installer-main.ps1 b/contrib/cirrus/win-installer-main.ps1 index 09fa4f17e6..6a0dc56f83 100644 --- a/contrib/cirrus/win-installer-main.ps1 +++ b/contrib/cirrus/win-installer-main.ps1 @@ -20,11 +20,7 @@ Push-Location $WIN_INST_FOLDER # Download the previous installer to test a major update if (!$env:PREV_SETUP_EXE_PATH) { - # After v5.3.2 is released we should replace - # `Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"` - # with - # `Get-Latest-Podman-Setup-From-GitHub` - $env:PREV_SETUP_EXE_PATH = Get-Podman-Setup-From-GitHub -version "tags/v5.3.0" + $env:PREV_SETUP_EXE_PATH = Get-Latest-Podman-Setup-From-GitHub } # Note: consumes podman-remote-release-windows_amd64.zip from repo.tar.zst diff --git a/contrib/win-installer/burn.wxs b/contrib/win-installer/burn.wxs index 9481b7a9e8..0c077eee16 100644 --- a/contrib/win-installer/burn.wxs +++ b/contrib/win-installer/burn.wxs @@ -22,6 +22,11 @@ + + diff --git a/contrib/win-installer/podman.wxs b/contrib/win-installer/podman.wxs index 10ca61c5bc..25026eb906 100644 --- a/contrib/win-installer/podman.wxs +++ b/contrib/win-installer/podman.wxs @@ -10,7 +10,7 @@ - + diff --git a/contrib/win-installer/test-installer.ps1 b/contrib/win-installer/test-installer.ps1 index f3ced04695..ba2bb19206 100644 --- a/contrib/win-installer/test-installer.ps1 +++ b/contrib/win-installer/test-installer.ps1 @@ -1,10 +1,6 @@ #!/usr/bin/env pwsh -# Usage examples: -# -# 1) Build a v9.9.9 installer and run `update-without-user-chages` -# scenario without specifying the previous setup exe (it will download from -# GitHub): +# Usage example: # # rm .\contrib\win-installer\*.log && # rm .\contrib\win-installer\*.exe && @@ -12,7 +8,7 @@ # .\winmake.ps1 installer && # .\winmake.ps1 installer 9.9.9 && # .\contrib\win-installer\test-installer.ps1 ` -# -scenario update-without-user-changes ` +# -scenario all ` # -previousSetupExePath ".\contrib\win-installer\podman-5.3.0-dev-setup.exe" ` # -setupExePath ".\contrib\win-installer\podman-5.4.0-dev-setup.exe" ` # -nextSetupExePath ".\contrib\win-installer\podman-9.9.9-dev-setup.exe" ` @@ -25,6 +21,7 @@ param ( [ValidateSet("test-objects-exist", "test-objects-exist-not", "installation-green-field", "installation-skip-config-creation-flag", "installation-with-pre-existing-podman-exe", "update-without-user-changes", "update-with-user-changed-config-file", "update-with-user-removed-config-file", "update-without-user-changes-to-next", "update-with-user-changed-config-file-to-next", "update-with-user-removed-config-file-to-next", + "update-without-user-changes-from-531", "all")] [string]$scenario, [ValidateScript({Test-Path $_ -PathType Leaf})] @@ -101,6 +98,25 @@ function Install-Podman-With-Defaults { } Write-Host "Installation completed successfully!`n" } +function Install-Podman-With-Defaults-Expected-Fail { + param ( + [Parameter(Mandatory)] + [ValidateScript({Test-Path $_ -PathType Leaf})] + [string]$setupExePath + ) + + Write-Host "Running the installer using defaults ($setupExePath)..." + $ret = Start-Process -Wait ` + -PassThru "$setupExePath" ` + -ArgumentList "/install /quiet ` + /log $PSScriptRoot\podman-setup-default.log" + if ($ret.ExitCode -eq 0) { + Write-Host "Install completed successfully but a failure was expected, dumping log" + Get-Content $PSScriptRoot\podman-setup-default.log + throw "Exit code is $($ret.ExitCode)" + } + Write-Host "Installation has failed as expected!`n" +} function Install-Current-Podman { Install-Podman -setupExePath $setupExePath @@ -259,7 +275,7 @@ function Start-Scenario-Installation-With-Pre-Existing-Podman-Exe { function Start-Scenario-Update-Without-User-Changes { param ( - [ValidateSet("From-Previous", "To-Next")] + [ValidateSet("From-Previous", "To-Next", "From-v531")] [string]$mode="From-Previous" ) Write-Host "`n======================================================" @@ -268,12 +284,22 @@ function Start-Scenario-Update-Without-User-Changes { switch ($mode) { 'From-Previous' {$i = $previousSetupExePath; $u = $setupExePath} 'To-Next' {$i = $setupExePath; $u = $nextSetupExePath} + 'From-v531' {$i = $v531SetupExePath; $u = $setupExePath} } Install-Podman -setupExePath $i Test-Installation - Install-Podman-With-Defaults -setupExePath $u - Test-Installation - Uninstall-Podman -setupExePath $u + + # Updates are expected to succeed except when updating from v5.3.1 + # The v5.3.1 installer has a bug that is patched in v5.3.2 + # Upgrading from v5.3.1 requires upgrading to v5.3.2 first + if ($mode -eq "From-Previous" -or $mode -eq "To-Next") { + Install-Podman-With-Defaults -setupExePath $u + Test-Installation + Uninstall-Podman -setupExePath $u + } else { # From-v531 is expected to fail + Install-Podman-With-Defaults-Expected-Fail -setupExePath $u + Uninstall-Podman -setupExePath $i + } Test-Uninstallation } @@ -281,6 +307,10 @@ function Start-Scenario-Update-Without-User-Changes-To-Next { Start-Scenario-Update-Without-User-Changes -mode "To-Next" } +function Start-Scenario-Update-Without-User-Changes-From-v531 { + Start-Scenario-Update-Without-User-Changes -mode "From-v531" +} + function Start-Scenario-Update-With-User-Changed-Config-File { param ( [ValidateSet("From-Previous", "To-Next")] @@ -349,11 +379,7 @@ switch ($scenario) { } 'update-without-user-changes' { if (!$previousSetupExePath) { - # After v5.3.2 is released we should replace - # `Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"` - # with - # `Get-Latest-Podman-Setup-From-GitHub` - $previousSetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.0" + $previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub } Start-Scenario-Update-Without-User-Changes } @@ -363,13 +389,15 @@ switch ($scenario) { } Start-Scenario-Update-Without-User-Changes-To-Next } + 'update-without-user-changes-from-531' { + if (!$v531SetupExePath) { + $v531SetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1" + } + Start-Scenario-Update-Without-User-Changes-From-v531 + } 'update-with-user-changed-config-file' { if (!$previousSetupExePath) { - # After v5.3.2 is released we should replace - # `Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"` - # with - # `Get-Latest-Podman-Setup-From-GitHub` - $previousSetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.0" + $previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub } Start-Scenario-Update-With-User-Changed-Config-File } @@ -381,11 +409,7 @@ switch ($scenario) { } 'update-with-user-removed-config-file' { if (!$previousSetupExePath) { - # After v5.3.2 is released we should replace - # `Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"` - # with - # `Get-Latest-Podman-Setup-From-GitHub` - $previousSetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.0" + $previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub } Start-Scenario-Update-With-User-Removed-Config-File } @@ -400,11 +424,10 @@ switch ($scenario) { throw "Next version installer path is not defined. Use '-nextSetupExePath ' to define it." } if (!$previousSetupExePath) { - # After v5.3.2 is released we should replace - # `Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"` - # with - # `Get-Latest-Podman-Setup-From-GitHub` - $previousSetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.0" + $previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub + } + if (!$v531SetupExePath) { + $v531SetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1" } Start-Scenario-Installation-Green-Field Start-Scenario-Installation-Skip-Config-Creation-Flag @@ -415,5 +438,6 @@ switch ($scenario) { Start-Scenario-Update-With-User-Changed-Config-File-To-Next Start-Scenario-Update-With-User-Removed-Config-File Start-Scenario-Update-With-User-Removed-Config-File-To-Next + Start-Scenario-Update-Without-User-Changes-From-v531 } }