mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #25135 from l0rd/win-installer-block-351-upgrade
Avoid upgrading from v5.3.1 on Windows
This commit is contained in:
@ -20,11 +20,7 @@ Push-Location $WIN_INST_FOLDER
|
|||||||
# Download the previous installer to test a major update
|
# Download the previous installer to test a major update
|
||||||
|
|
||||||
if (!$env:PREV_SETUP_EXE_PATH) {
|
if (!$env:PREV_SETUP_EXE_PATH) {
|
||||||
# After v5.3.2 is released we should replace
|
$env:PREV_SETUP_EXE_PATH = Get-Latest-Podman-Setup-From-GitHub
|
||||||
# `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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Note: consumes podman-remote-release-windows_amd64.zip from repo.tar.zst
|
# Note: consumes podman-remote-release-windows_amd64.zip from repo.tar.zst
|
||||||
|
@ -22,6 +22,11 @@
|
|||||||
<util:RegistrySearch Id="CurrentBuild" Variable="CBNumber" Result="value" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Value="CurrentBuildNumber" />
|
<util:RegistrySearch Id="CurrentBuild" Variable="CBNumber" Result="value" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Value="CurrentBuildNumber" />
|
||||||
<bal:Condition Message="Windows 10 (19041) or later is required to run this application." Condition="VersionNT >= v10.0 AND (CBNumber >= 19041 OR AllowOldWin = 1)" />
|
<bal:Condition Message="Windows 10 (19041) or later is required to run this application." Condition="VersionNT >= v10.0 AND (CBNumber >= 19041 OR AllowOldWin = 1)" />
|
||||||
<bal:Condition Message="You have an installed development, pre-release version, or alternative build identifying as the same version of this installer. You must uninstall the existing version of Podman first, before proceeding." Condition="WixBundleInstalled OR WixBundleForcedRestartPackage OR PreviousVersion <> VERSION" />
|
<bal:Condition Message="You have an installed development, pre-release version, or alternative build identifying as the same version of this installer. You must uninstall the existing version of Podman first, before proceeding." Condition="WixBundleInstalled OR WixBundleForcedRestartPackage OR PreviousVersion <> VERSION" />
|
||||||
|
<!-- Next condition blocks upgrades from v5.3.1. That's because that version
|
||||||
|
of the installer has a bug (that got patched in v5.3.2) and upgrading
|
||||||
|
from v5.3.1 requires upgrading to v5.3.2 first.
|
||||||
|
c.f. https://github.com/containers/podman/issues/24735 -->
|
||||||
|
<bal:Condition Message="You have v5.3.1 of Podman installed and upgrading to this version is not allowed. You must upgrade to v5.3.2 first." Condition="PreviousVersion <> v5.3.1" />
|
||||||
<Chain>
|
<Chain>
|
||||||
<MsiPackage Id="Setup" SourceFile="en-US\podman.msi" Vital="yes">
|
<MsiPackage Id="Setup" SourceFile="en-US\podman.msi" Vital="yes">
|
||||||
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
|
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<?define UseGVProxy = ""?>
|
<?define UseGVProxy = ""?>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
<Package Name="podman" Manufacturer="Red Hat Inc." Version="$(VERSION)" UpgradeCode="a6a9dd9c-0732-44ba-9279-ffe22ea50671" ProductCode="18107131-1820-4878-8AEE-65AAE37BC1E3">
|
<Package Name="podman" Manufacturer="Red Hat Inc." Version="$(VERSION)" UpgradeCode="a6a9dd9c-0732-44ba-9279-ffe22ea50671">
|
||||||
<Media Id="1" Cabinet="Podman.cab" EmbedCab="yes" />
|
<Media Id="1" Cabinet="Podman.cab" EmbedCab="yes" />
|
||||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." RemoveFeatures="Complete" Schedule="afterInstallExecute" />
|
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." RemoveFeatures="Complete" Schedule="afterInstallExecute" />
|
||||||
<Property Id="DiskPrompt" Value="Red Hat's Podman $(VERSION) Installation" />
|
<Property Id="DiskPrompt" Value="Red Hat's Podman $(VERSION) Installation" />
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
# Usage examples:
|
# Usage example:
|
||||||
#
|
|
||||||
# 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):
|
|
||||||
#
|
#
|
||||||
# rm .\contrib\win-installer\*.log &&
|
# rm .\contrib\win-installer\*.log &&
|
||||||
# rm .\contrib\win-installer\*.exe &&
|
# rm .\contrib\win-installer\*.exe &&
|
||||||
@ -12,7 +8,7 @@
|
|||||||
# .\winmake.ps1 installer &&
|
# .\winmake.ps1 installer &&
|
||||||
# .\winmake.ps1 installer 9.9.9 &&
|
# .\winmake.ps1 installer 9.9.9 &&
|
||||||
# .\contrib\win-installer\test-installer.ps1 `
|
# .\contrib\win-installer\test-installer.ps1 `
|
||||||
# -scenario update-without-user-changes `
|
# -scenario all `
|
||||||
# -previousSetupExePath ".\contrib\win-installer\podman-5.3.0-dev-setup.exe" `
|
# -previousSetupExePath ".\contrib\win-installer\podman-5.3.0-dev-setup.exe" `
|
||||||
# -setupExePath ".\contrib\win-installer\podman-5.4.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" `
|
# -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",
|
[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", "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-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")]
|
"all")]
|
||||||
[string]$scenario,
|
[string]$scenario,
|
||||||
[ValidateScript({Test-Path $_ -PathType Leaf})]
|
[ValidateScript({Test-Path $_ -PathType Leaf})]
|
||||||
@ -101,6 +98,25 @@ function Install-Podman-With-Defaults {
|
|||||||
}
|
}
|
||||||
Write-Host "Installation completed successfully!`n"
|
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 {
|
function Install-Current-Podman {
|
||||||
Install-Podman -setupExePath $setupExePath
|
Install-Podman -setupExePath $setupExePath
|
||||||
@ -259,7 +275,7 @@ function Start-Scenario-Installation-With-Pre-Existing-Podman-Exe {
|
|||||||
|
|
||||||
function Start-Scenario-Update-Without-User-Changes {
|
function Start-Scenario-Update-Without-User-Changes {
|
||||||
param (
|
param (
|
||||||
[ValidateSet("From-Previous", "To-Next")]
|
[ValidateSet("From-Previous", "To-Next", "From-v531")]
|
||||||
[string]$mode="From-Previous"
|
[string]$mode="From-Previous"
|
||||||
)
|
)
|
||||||
Write-Host "`n======================================================"
|
Write-Host "`n======================================================"
|
||||||
@ -268,12 +284,22 @@ function Start-Scenario-Update-Without-User-Changes {
|
|||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
'From-Previous' {$i = $previousSetupExePath; $u = $setupExePath}
|
'From-Previous' {$i = $previousSetupExePath; $u = $setupExePath}
|
||||||
'To-Next' {$i = $setupExePath; $u = $nextSetupExePath}
|
'To-Next' {$i = $setupExePath; $u = $nextSetupExePath}
|
||||||
|
'From-v531' {$i = $v531SetupExePath; $u = $setupExePath}
|
||||||
}
|
}
|
||||||
Install-Podman -setupExePath $i
|
Install-Podman -setupExePath $i
|
||||||
Test-Installation
|
Test-Installation
|
||||||
Install-Podman-With-Defaults -setupExePath $u
|
|
||||||
Test-Installation
|
# Updates are expected to succeed except when updating from v5.3.1
|
||||||
Uninstall-Podman -setupExePath $u
|
# 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
|
Test-Uninstallation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,6 +307,10 @@ function Start-Scenario-Update-Without-User-Changes-To-Next {
|
|||||||
Start-Scenario-Update-Without-User-Changes -mode "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 {
|
function Start-Scenario-Update-With-User-Changed-Config-File {
|
||||||
param (
|
param (
|
||||||
[ValidateSet("From-Previous", "To-Next")]
|
[ValidateSet("From-Previous", "To-Next")]
|
||||||
@ -349,11 +379,7 @@ switch ($scenario) {
|
|||||||
}
|
}
|
||||||
'update-without-user-changes' {
|
'update-without-user-changes' {
|
||||||
if (!$previousSetupExePath) {
|
if (!$previousSetupExePath) {
|
||||||
# After v5.3.2 is released we should replace
|
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
|
||||||
# `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"
|
|
||||||
}
|
}
|
||||||
Start-Scenario-Update-Without-User-Changes
|
Start-Scenario-Update-Without-User-Changes
|
||||||
}
|
}
|
||||||
@ -363,13 +389,15 @@ switch ($scenario) {
|
|||||||
}
|
}
|
||||||
Start-Scenario-Update-Without-User-Changes-To-Next
|
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' {
|
'update-with-user-changed-config-file' {
|
||||||
if (!$previousSetupExePath) {
|
if (!$previousSetupExePath) {
|
||||||
# After v5.3.2 is released we should replace
|
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
|
||||||
# `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"
|
|
||||||
}
|
}
|
||||||
Start-Scenario-Update-With-User-Changed-Config-File
|
Start-Scenario-Update-With-User-Changed-Config-File
|
||||||
}
|
}
|
||||||
@ -381,11 +409,7 @@ switch ($scenario) {
|
|||||||
}
|
}
|
||||||
'update-with-user-removed-config-file' {
|
'update-with-user-removed-config-file' {
|
||||||
if (!$previousSetupExePath) {
|
if (!$previousSetupExePath) {
|
||||||
# After v5.3.2 is released we should replace
|
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
|
||||||
# `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"
|
|
||||||
}
|
}
|
||||||
Start-Scenario-Update-With-User-Removed-Config-File
|
Start-Scenario-Update-With-User-Removed-Config-File
|
||||||
}
|
}
|
||||||
@ -400,11 +424,10 @@ switch ($scenario) {
|
|||||||
throw "Next version installer path is not defined. Use '-nextSetupExePath <setup-exe-path>' to define it."
|
throw "Next version installer path is not defined. Use '-nextSetupExePath <setup-exe-path>' to define it."
|
||||||
}
|
}
|
||||||
if (!$previousSetupExePath) {
|
if (!$previousSetupExePath) {
|
||||||
# After v5.3.2 is released we should replace
|
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
|
||||||
# `Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"`
|
}
|
||||||
# with
|
if (!$v531SetupExePath) {
|
||||||
# `Get-Latest-Podman-Setup-From-GitHub`
|
$v531SetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1"
|
||||||
$previousSetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.0"
|
|
||||||
}
|
}
|
||||||
Start-Scenario-Installation-Green-Field
|
Start-Scenario-Installation-Green-Field
|
||||||
Start-Scenario-Installation-Skip-Config-Creation-Flag
|
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-Changed-Config-File-To-Next
|
||||||
Start-Scenario-Update-With-User-Removed-Config-File
|
Start-Scenario-Update-With-User-Removed-Config-File
|
||||||
Start-Scenario-Update-With-User-Removed-Config-File-To-Next
|
Start-Scenario-Update-With-User-Removed-Config-File-To-Next
|
||||||
|
Start-Scenario-Update-Without-User-Changes-From-v531
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user