Skip to content

Commit

Permalink
Stop creating a patch for v5.3.1 upgrades on windows
Browse files Browse the repository at this point in the history
Removes the windows installer patch for upgrading
from v5.3.1 to v5.3.x that was introduced in
containers#24827.

We need to do that because windows patches are
allowed only for small and minor updates
https://learn.microsoft.com/en-us/windows/win32/msi/patching-and-upgrades.

We also need to start blocking upgrades from v5.3.1
to v5.4.x, which will be implemented in a separate commit.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
  • Loading branch information
l0rd committed Jan 15, 2025
1 parent 5577dcf commit da8c8e4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 104 deletions.
16 changes: 5 additions & 11 deletions contrib/cirrus/win-installer-main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,13 @@ Push-Location $WIN_INST_FOLDER

# Build and test the windows installer

# Download v5.3.1 installer as `build.ps1` uses it to build the patch
# (podman.msp). `build.ps1` reads `$env:V531_SETUP_EXE_PATH` to get its path.
# The v5.3.1 installer is also used to test the "v5.3.1 -> current" version minor
# update (with patch).
if (!$env:V531_SETUP_EXE_PATH) {
$env:V531_SETUP_EXE_PATH = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1"
}
# Download the previous installer to test a major update

# Download the previous installer to test a major update (without patch)
# After v5.3.2 release we should download latest instead of v5.3.0 (i.e.
# `Get-Latest-Podman-Setup-From-GitHub`)
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"
}

Expand All @@ -48,5 +43,4 @@ $command += "-provider $ENV:CONTAINERS_MACHINE_PROVIDER "
$command += "-setupExePath `"$WIN_INST_FOLDER\podman-$ENV:WIN_INST_VER-dev-setup.exe`""
$command += "-previousSetupExePath `"$env:PREV_SETUP_EXE_PATH`""
$command += "-nextSetupExePath `"$WIN_INST_FOLDER\podman-$NEXT_WIN_INST_VER-dev-setup.exe`""
$command += "-v531SetupExePath `"$env:V531_SETUP_EXE_PATH`""
Run-Command "${command}"
20 changes: 0 additions & 20 deletions contrib/win-installer/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,6 @@ function CheckRequirements() {
CheckCommand "go" "Golang"
}

function Build-531-Patch() {
param(
[ValidateScript({Test-Path $_ -PathType Leaf})]
[string]$v531SetupExePath=$ENV:V531_SETUP_EXE_PATH
)

if (!$v531SetupExePath) {
. $PSScriptRoot\utils.ps1
$v531SetupExePath=Get-Podman-Setup-From-GitHub "tags/v5.3.1"
}
wix burn extract $v531SetupExePath -o $PSScriptRoot\prevPodmanMsi; ExitOnError
Move-Item $PSScriptRoot\prevPodmanMsi\a1 $PSScriptRoot\en-US\prev-podman.wixpdb -Force; ExitOnError
Move-Item $PSScriptRoot\prevPodmanMsi\a0 $PSScriptRoot\en-US\prev-podman.msi -Force; ExitOnError
wix build -define "Version=$ENV:INSTVER" -bindpath $PSScriptRoot\en-US -out $PSScriptRoot\en-US\podman.msp podman-patch.wxs; ExitOnError
}

if ($args.Count -lt 1 -or $args[0].Length -lt 1) {
Write-Host "Usage: " $MyInvocation.MyCommand.Name "<version> [dev|prod] [release_dir]"
Write-Host
Expand Down Expand Up @@ -145,10 +129,6 @@ if (Test-Path ./obj) {
dotnet build podman.wixproj /property:DefineConstants="VERSION=$ENV:INSTVER" -o .; ExitOnError
SignItem @("en-US\podman.msi")

# Build the Patch for 5.3.1
Build-531-Patch
SignItem @("en-US\podman.msp")

dotnet build podman-setup.wixproj /property:DefineConstants="VERSION=$ENV:INSTVER" -o .; ExitOnError
wix burn detach podman-setup.exe -engine engine.exe; ExitOnError
SignItem @("engine.exe")
Expand Down
1 change: 0 additions & 1 deletion contrib/win-installer/burn.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<MsiProperty Name="WITH_HYPERV" Value="[HyperVCheckbox]" />
<MsiProperty Name="SKIP_CONFIG_FILE_CREATION" Value="[SkipConfigFileCreation]" />
</MsiPackage>
<MspPackage Id="Patch" SourceFile="en-US\podman.msp" Vital="yes" />
<ExePackage DisplayName="WSL Kernel Install" InstallCondition="(MachineProvider = &quot;wsl&quot;) AND (WSLCheckbox = 1) AND (NOT PreviousInstallFolder)" SourceFile="artifacts\podman-wslkerninst.exe" DetectCondition="" Permanent="true" />
</Chain>
<OptionalUpdateRegistration />
Expand Down
21 changes: 0 additions & 21 deletions contrib/win-installer/podman-patch.wxs

This file was deleted.

73 changes: 23 additions & 50 deletions contrib/win-installer/test-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# -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" `
# -v531SetupExePath ".\contrib\win-installer\podman-5.3.1-dev-setup.exe" `
# -provider hyperv
#

Expand All @@ -25,7 +24,6 @@ param (
[Parameter(Mandatory)]
[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-from-531", "update-with-user-changed-config-file-from-531", "update-with-user-removed-config-file-from-531",
"update-without-user-changes-to-next", "update-with-user-changed-config-file-to-next", "update-with-user-removed-config-file-to-next",
"all")]
[string]$scenario,
Expand All @@ -35,8 +33,6 @@ param (
[string]$previousSetupExePath,
[ValidateScript({Test-Path $_ -PathType Leaf})]
[string]$nextSetupExePath,
[ValidateScript({Test-Path $_ -PathType Leaf})]
[string]$v531SetupExePath,
[ValidateSet("wsl", "hyperv")]
[string]$provider="wsl",
[switch]$installWSL=$false,
Expand Down Expand Up @@ -263,15 +259,14 @@ function Start-Scenario-Installation-With-Pre-Existing-Podman-Exe {

function Start-Scenario-Update-Without-User-Changes {
param (
[ValidateSet("From-Previous", "From-531", "To-Next")]
[ValidateSet("From-Previous", "To-Next")]
[string]$mode="From-Previous"
)
Write-Host "`n======================================================"
Write-Host " Running scenario: Update-Without-User-Changes-$mode"
Write-Host "======================================================"
switch ($mode) {
'From-Previous' {$i = $previousSetupExePath; $u = $setupExePath}
'From-531' {$i = $v531SetupExePath; $u = $setupExePath}
'To-Next' {$i = $setupExePath; $u = $nextSetupExePath}
}
Install-Podman -setupExePath $i
Expand All @@ -282,25 +277,20 @@ function Start-Scenario-Update-Without-User-Changes {
Test-Uninstallation
}

function Start-Scenario-Update-Without-User-Changes-From-531 {
Start-Scenario-Update-Without-User-Changes -mode "From-531"
}

function Start-Scenario-Update-Without-User-Changes-To-Next {
Start-Scenario-Update-Without-User-Changes -mode "To-Next"
}

function Start-Scenario-Update-With-User-Changed-Config-File {
param (
[ValidateSet("From-Previous", "From-531", "To-Next")]
[ValidateSet("From-Previous", "To-Next")]
[string]$mode="From-Previous"
)
Write-Host "`n=============================================================="
Write-Host " Running scenario: Update-With-User-Changed-Config-File-$mode"
Write-Host "=============================================================="
switch ($mode) {
'From-Previous' {$i = $previousSetupExePath; $u = $setupExePath}
'From-531' {$i = $v531SetupExePath; $u = $setupExePath}
'To-Next' {$i = $setupExePath; $u = $nextSetupExePath}
}
Install-Podman -setupExePath $i
Expand All @@ -312,25 +302,20 @@ function Start-Scenario-Update-With-User-Changed-Config-File {
Test-Uninstallation
}

function Start-Scenario-Update-With-User-Changed-Config-File-From-531 {
Start-Scenario-Update-With-User-Changed-Config-File -mode "From-531"
}

function Start-Scenario-Update-With-User-Changed-Config-File-To-Next {
Start-Scenario-Update-With-User-Changed-Config-File -mode "To-Next"
}

function Start-Scenario-Update-With-User-Removed-Config-File {
param (
[ValidateSet("From-Previous", "From-531", "To-Next")]
[ValidateSet("From-Previous", "To-Next")]
[string]$mode="From-Previous"
)
Write-Host "`n=============================================================="
Write-Host " Running scenario: Update-With-User-Removed-Config-File-$mode"
Write-Host "=============================================================="
switch ($mode) {
'From-Previous' {$i = $previousSetupExePath; $u = $setupExePath}
'From-531' {$i = $v531SetupExePath; $u = $setupExePath}
'To-Next' {$i = $setupExePath; $u = $nextSetupExePath}
}
Install-Podman -setupExePath $i
Expand All @@ -342,10 +327,6 @@ function Start-Scenario-Update-With-User-Removed-Config-File {
Test-Uninstallation
}

function Start-Scenario-Update-With-User-Removed-Config-File-From-531 {
Start-Scenario-Update-With-User-Removed-Config-File -mode "From-531"
}

function Start-Scenario-Update-With-User-Removed-Config-File-To-Next {
Start-Scenario-Update-With-User-Removed-Config-File -mode "To-Next"
}
Expand All @@ -368,16 +349,14 @@ switch ($scenario) {
}
'update-without-user-changes' {
if (!$previousSetupExePath) {
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
# 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"
}
Start-Scenario-Update-Without-User-Changes
}
'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-531
}
'update-without-user-changes-to-next' {
if (!$nextSetupExePath) {
throw "Next version installer path is not defined. Use '-nextSetupExePath <setup-exe-path>' to define it."
Expand All @@ -386,16 +365,14 @@ switch ($scenario) {
}
'update-with-user-changed-config-file' {
if (!$previousSetupExePath) {
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
# 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"
}
Start-Scenario-Update-With-User-Changed-Config-File
}
'update-with-user-changed-config-file-from-531' {
if (!$v531SetupExePath) {
$v531SetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1"
}
Start-Scenario-Update-With-User-Changed-Config-File-From-531
}
'update-with-user-changed-config-file-to-next' {
if (!$nextSetupExePath) {
throw "Next version installer path is not defined. Use '-nextSetupExePath <setup-exe-path>' to define it."
Expand All @@ -404,16 +381,14 @@ switch ($scenario) {
}
'update-with-user-removed-config-file' {
if (!$previousSetupExePath) {
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
# 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"
}
Start-Scenario-Update-With-User-Removed-Config-File
}
'update-with-user-removed-config-file-from-531' {
if (!$v531SetupExePath) {
$v531SetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1"
}
Start-Scenario-Update-With-User-Removed-Config-File-From-531
}
'update-with-user-removed-config-file-to-next' {
if (!$nextSetupExePath) {
throw "Next version installer path is not defined. Use '-nextSetupExePath <setup-exe-path>' to define it."
Expand All @@ -425,22 +400,20 @@ switch ($scenario) {
throw "Next version installer path is not defined. Use '-nextSetupExePath <setup-exe-path>' to define it."
}
if (!$previousSetupExePath) {
$previousSetupExePath = Get-Latest-Podman-Setup-From-GitHub
}
if (!$v531SetupExePath) {
$v531SetupExePath = Get-Podman-Setup-From-GitHub -version "tags/v5.3.1"
# 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"
}
Start-Scenario-Installation-Green-Field
Start-Scenario-Installation-Skip-Config-Creation-Flag
Start-Scenario-Installation-With-Pre-Existing-Podman-Exe
Start-Scenario-Update-Without-User-Changes
Start-Scenario-Update-Without-User-Changes-From-531
Start-Scenario-Update-Without-User-Changes-To-Next
Start-Scenario-Update-With-User-Changed-Config-File
Start-Scenario-Update-With-User-Changed-Config-File-From-531
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-From-531
Start-Scenario-Update-With-User-Removed-Config-File-To-Next
}
}
2 changes: 1 addition & 1 deletion winmake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Win-SSHProxy {

New-Item -ItemType Directory -Force -Path "./bin/windows"
if (-Not $Version) {
$Version = "v0.7.2"
$Version = "v0.8.1"
}
curl.exe -sSL -o "./bin/windows/gvproxy.exe" --retry 5 "/~https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/gvproxy-windowsgui.exe"
curl.exe -sSL -o "./bin/windows/win-sshproxy.exe" --retry 5 "/~https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/win-sshproxy.exe"
Expand Down

0 comments on commit da8c8e4

Please sign in to comment.