Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI:DOCS] Installer: Use windows image with latest wix #22408

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
DEBIAN_NAME: "debian-13"

# Image identifiers
IMAGE_SUFFIX: "c20240506t132946z-f40f39d13"
#IMAGE_SUFFIX: "c20240411t124913z-f39f38d13"
IMAGE_SUFFIX: "c20240510t174901z-f40f39d13"

# EC2 images
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
Expand Down Expand Up @@ -397,7 +398,7 @@
# Status aggregator for all builds. This task simply makes dependency
# management easier, and results in a simpler graph that using YAML
# anchors/aliases.
build_success_task:

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Validate fedora-40 Build", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Validate rawhide Build", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Validate fedora-40-aarch64 Build", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Build Each Commit", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Windows Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. x86 Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. ARM Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. MIPS Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. MIPS64 Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. Other Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "OSX Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "FreeBSD Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Validate fedora-40 Build", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Validate rawhide Build", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Validate fedora-40-aarch64 Build", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Build Each Commit", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Windows Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. x86 Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. ARM Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. MIPS Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. MIPS64 Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "Alt Arch. Other Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "OSX Cross", but their only_if conditions are different

Check warning on line 401 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L401

task "Total Build Success" depends on task "FreeBSD Cross", but their only_if conditions are different
name: "Total Build Success"
alias: build_success
depends_on:
Expand Down Expand Up @@ -488,6 +489,11 @@

win_installer_task:
name: "Verify Win Installer Build"
matrix:
- env:
CONTAINERS_MACHINE_PROVIDER: 'wsl'
- env:
CONTAINERS_MACHINE_PROVIDER: 'hyperv'
alias: win_installer
only_if: # RHEL never releases podman windows installer binary
$CIRRUS_TAG == '' &&
Expand Down Expand Up @@ -1060,7 +1066,7 @@

# Status aggregator for all tests. This task ensures a defined set of tasks
# all passed, and allows confirming that based on the status of this task.
success_task:

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "bindings", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "docker-py_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "unit_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "apiv2_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "compose_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "container_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine_windows", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine_mac", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_system_test_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "minikube_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "farm_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "buildah_bud_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "upgrade_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "Test Swagger", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "Verify Win Installer Build", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "Verify Win Installer Build", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "bindings", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "docker-py_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "unit_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "apiv2_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "compose_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "container_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_integration_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine_windows", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "podman_machine_mac", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_system_test_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "local_system_test_aarch64", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_remote_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "rootless_system_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "minikube_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "farm_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "buildah_bud_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "upgrade_test", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "Test Swagger", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "Verify Win Installer Build", but their only_if conditions are different

Check warning on line 1069 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L1069

task "Total Success" depends on task "Verify Win Installer Build", but their only_if conditions are different
# N/B: The prow merge-bot (tide) is sensitized to this exact name, DO NOT CHANGE IT.
# Ref: https://github.com/openshift/release/pull/48855
name: "Total Success"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/upload-win-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
- name: Dry Run Status
run: |
Write-Output "::notice::This workflow execution will be a dry-run: ${{ steps.actual_dryrun.outputs.dryrun }}"
- name: Install Wix and WixToolset.Heat
run: |
dotnet tool install --global wix
dotnet new console
dotnet add package WixToolset.Heat --version 5.0.0
- name: Determine version
id: getversion
run: |
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ result
# Necessary to prevent hack/tree-status.sh false-positive
/*runner_stats.log
.generate-bindings
contrib/win-installer/artifacts/
contrib/win-installer/docs/
contrib/win-installer/fetch/
contrib/win-installer/podman.msi
contrib/win-installer/podman-*setup.exe
contrib/win-installer/engine.exe
contrib/win-installer/shasums
contrib/win-installer/pages.wxs
contrib/win-installer/*.wixobj
contrib/win-installer/*.wixpdb
56 changes: 28 additions & 28 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ actions:
- "bash .packit.sh"

jobs:
- job: copr_build
trigger: pull_request
packages: [podman-fedora]
notifications:
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
enable_net: true
targets:
- fedora-all-x86_64
- fedora-all-aarch64
- fedora-eln-x86_64
- fedora-eln-aarch64
additional_repos:
- "copr://rhcontainerbot/podman-next"
#- job: copr_build
# trigger: pull_request
# packages: [podman-fedora]
# notifications:
# failure_comment:
# message: "Ephemeral COPR build failed. @containers/packit-build please check."
# enable_net: true
# targets:
# - fedora-all-x86_64
# - fedora-all-aarch64
# - fedora-eln-x86_64
# - fedora-eln-aarch64
# additional_repos:
# - "copr://rhcontainerbot/podman-next"

- job: copr_build
trigger: pull_request
packages: [podman-centos]
notifications:
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
enable_net: true
targets:
- epel-9-x86_64
- epel-9-aarch64
- centos-stream-10-x86_64
- centos-stream-10-aarch64
additional_repos:
- "copr://rhcontainerbot/podman-next"
#- job: copr_build
# trigger: pull_request
# packages: [podman-centos]
# notifications:
# failure_comment:
# message: "Ephemeral COPR build failed. @containers/packit-build please check."
# enable_net: true
# targets:
# - epel-9-x86_64
# - epel-9-aarch64
# - centos-stream-10-x86_64
# - centos-stream-10-aarch64
# additional_repos:
# - "copr://rhcontainerbot/podman-next"

# Run on commit to main branch
- job: copr_build
Expand Down
51 changes: 44 additions & 7 deletions contrib/cirrus/win-installer-main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,59 @@

. $PSScriptRoot\win-lib.ps1

Set-Location "$ENV:CIRRUS_WORKING_DIR\repo\contrib\win-installer"
if ($Env:CI -eq "true") {
$WIN_INST_FOLDER = "$ENV:CIRRUS_WORKING_DIR\repo\contrib\win-installer"
$RELEASE_DIR = "$ENV:CIRRUS_WORKING_DIR\repo"
} else {
$WIN_INST_FOLDER = "$PSScriptRoot\..\win-installer"
$ENV:WIN_INST_VER = "9.9.9"
$RELEASE_DIR = "$PSScriptRoot\..\.."
$ENV:CONTAINERS_MACHINE_PROVIDER = "wsl"
}

$ConfFilePath = "$env:ProgramData\containers\containers.conf.d\99-podman-machine-provider.conf"
$WindowsPathsToTest = @("C:\Program Files\RedHat\Podman\podman.exe",
"C:\Program Files\RedHat\Podman\win-sshproxy.exe",
"$ConfFilePath",
"HKLM:\SOFTWARE\Red Hat\Podman")

Set-Location $WIN_INST_FOLDER

# Build Installer
# Note: consumes podman-remote-release-windows_amd64.zip from repo.tbz2
Run-Command ".\build.ps1 $Env:WIN_INST_VER dev `"$ENV:CIRRUS_WORKING_DIR\repo`""
Run-Command ".\build.ps1 $Env:WIN_INST_VER dev `"$RELEASE_DIR`""

# Run the installer silently and WSL install option disabled (prevent reboots, wsl requirements)
# Run the installer silently and WSL/HyperV install options disabled (prevent reboots)
# We need AllowOldWin=1 for server 2019 (cirrus image), can be dropped after server 2022
$ret = Start-Process -Wait -PassThru ".\podman-${ENV:WIN_INST_VER}-dev-setup.exe" -ArgumentList "/install /quiet WSLCheckbox=0 AllowOldWin=1 /log inst.log"
$ret = Start-Process -Wait -PassThru ".\podman-${ENV:WIN_INST_VER}-dev-setup.exe" -ArgumentList "/install /quiet MachineProvider=$ENV:CONTAINERS_MACHINE_PROVIDER WSLCheckbox=0 HyperVCheckbox=0 AllowOldWin=1 /log inst.log"
if ($ret.ExitCode -ne 0) {
Write-Host "Install failed, dumping log"
Get-Content inst.log
throw "Exit code is $($ret.ExitCode)"
}
if (! ((Test-Path -Path "C:\Program Files\RedHat\Podman\podman.exe") -and `
(Test-Path -Path "C:\Program Files\RedHat\Podman\win-sshproxy.exe"))) {
throw "Expected podman.exe and win-sshproxy.exe, one or both not present after install"
$WindowsPathsToTest | ForEach-Object {
if (! (Test-Path -Path $_) ) {
throw "Expected $_ but it's not present after uninstall"
}
}
$machineProvider = Get-Content $ConfFilePath | Select-Object -Skip 1 | ConvertFrom-StringData | ForEach-Object { $_.provider }
if ( $machineProvider -ne "`"$ENV:CONTAINERS_MACHINE_PROVIDER`"" ) {
throw "Expected `"$ENV:CONTAINERS_MACHINE_PROVIDER`" as default machine provider but got $machineProvider"
}

Write-Host "Installer verification successful!"

# Run the uninstaller silently to verify that it cleans up properly
$ret = Start-Process -Wait -PassThru ".\podman-${ENV:WIN_INST_VER}-dev-setup.exe" -ArgumentList "/uninstall /quiet /log uninst.log"
if ($ret.ExitCode -ne 0) {
Write-Host "Uninstall failed, dumping log"
Get-Content uninst.log
throw "Exit code is $($ret.ExitCode)"
}
$WindowsPathsToTest | ForEach-Object {
if ( Test-Path -Path $_ ) {
throw "Path $_ is still present after uninstall"
}
}

Write-Host "Uninstaller verification successful!"
9 changes: 6 additions & 3 deletions contrib/win-installer/build-msi.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
@exit /b 1
)

heat dir docs -var var.ManSource -cg ManFiles -dr INSTALLDIR -gg -g1 -srd -out pages.wxs || exit /b 1
candle -ext WixUIExtension -ext WixUtilExtension -ext .\artifacts\PanelSwWixExtension.dll -arch x64 -dManSource="docs" -dVERSION="%1" podman.wxs pages.wxs podman-ui.wxs welcome-install-dlg.wxs || exit /b 1
light -ext WixUIExtension -ext WixUtilExtension -ext .\artifacts\PanelSwWixExtension.dll .\podman.wixobj .\pages.wixobj .\podman-ui.wixobj .\welcome-install-dlg.wixobj -out podman.msi || exit /b 1
::~\.nuget\packages\wixtoolset.heat\5.0.0\tools\net472\x64\heat.exe dir ..\..\docs -var var.ManSource -cg ManFiles -dr INSTALLDIR -gg -g1 -srd -out pages.wxs || exit /b 1
::wix build -o podman.msi podman.wxs pages.wxs podman-ui.wxs welcome-install-dlg.wxs || exit /b 1
wix build -o podman.msi podman.wxs podman-ui.wxs welcome-install-dlg.wxs || exit /b 1

::candle -ext WixUIExtension -ext WixUtilExtension -ext .\artifacts\PanelSwWixExtension.dll -arch x64 -dManSource="docs" -dVERSION="%1" podman.wxs pages.wxs podman-ui.wxs welcome-install-dlg.wxs || exit /b 1
::light -ext WixUIExtension -ext WixUtilExtension -ext .\artifacts\PanelSwWixExtension.dll .\podman.wixobj .\pages.wixobj .\podman-ui.wixobj .\welcome-install-dlg.wixobj -out podman.msi || exit /b 1
13 changes: 10 additions & 3 deletions contrib/win-installer/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ function CheckCommand() {
}
}

# Needed to run the `heat` command
pushd ..\..
& 'C:\Program Files\dotnet\dotnet.exe' add package WixToolset.Heat
popd

function CheckRequirements() {
CheckCommand "gcc" "MingW CC"
CheckCommand "candle" "WiX Toolset"
CheckCommand "wix" "WiX Toolset"
CheckCommand "~\.nuget\packages\wixtoolset.heat\5.0.0\tools\net472\x64\heat.exe" "WixToolset.Heat"
CheckCommand "go" "Golang"
}

Expand All @@ -98,8 +104,9 @@ if ($args.Count -lt 1 -or $args[0].Length -lt 1) {
Exit 1
}

# Pre-set to standard locations in-case build env does not refresh paths
$Env:Path="$Env:Path;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;;C:\Program Files\Go\bin"
# Pre-set to standard locations in-case build env does not refresh paths.
# WiX is in the default path in the windows image used, so we don't need to specify it explicitly here.
$Env:Path="$Env:Path;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;;C:\Program Files\Go\bin"

CheckRequirements

Expand Down
57 changes: 25 additions & 32 deletions contrib/win-installer/burn.wxs
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<?ifndef var.VERSION?>
<?error VERSION must be defined via command line argument?>
<?endif?>
<Bundle Name="Podman" Version="$(var.VERSION)" Manufacturer="Red Hat"
UpgradeCode="f3e1f40a-a791-49b7-9bc6-050975293353" IconSourceFile="resources\podman-logo.ico"
Compressed="yes">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkSidebarLicense">
<bal:WixStandardBootstrapperApplication LicenseUrl=""
ThemeFile="podman-theme.xml"
LocalizationFile="podman-theme.wxl"
LogoFile="resources\podman-banner2.png"
LogoSideFile="resources\podman-sidebar.png"
SuppressOptionsUI="yes"
ShowVersion="yes"/>
</BootstrapperApplicationRef>
<Variable Name='InstallFolder' Type='string' Value='[ProgramFiles64Folder]RedHat\Podman' bal:Overridable="yes"/>
<Variable Name="VERSION" Value="$(var.VERSION)"/>
<Variable Name="WSLCheckbox" Type="numeric" Value="1" bal:Overridable="yes"/>
<Variable Name="AllowOldWin" Type="numeric" Value="0" bal:Overridable="yes"/>
<Variable Name="LaunchTarget" Value="explorer.exe"/>
<Variable Name="LaunchArguments" Value="&quot;[InstallFolder]\podman-for-windows.html&quot;"/>
<Bundle Name="Podman" Version="$(var.VERSION)" Manufacturer="Red Hat" UpgradeCode="f3e1f40a-a791-49b7-9bc6-050975293353" IconSourceFile="resources\podman-logo.ico" Compressed="yes">
<BootstrapperApplication>
<bal:WixStandardBootstrapperApplication LicenseUrl="" ThemeFile="podman-theme.xml" LocalizationFile="podman-theme.wxl" LogoFile="resources\podman-banner2.png" LogoSideFile="resources\podman-sidebar.png" SuppressOptionsUI="yes" ShowVersion="yes" Theme="hyperlinkSidebarLicense" />
</BootstrapperApplication>
<Variable Name="InstallFolder" Type="formatted" Value="[ProgramFiles64Folder]RedHat\Podman" bal:Overridable="yes" />
<Variable Name="VERSION" Value="$(var.VERSION)" Type="formatted" />
<Variable Name="MachineProvider" Type="formatted" Value="wsl" bal:Overridable="yes" />
<Variable Name="WSLCheckbox" Type="numeric" Value="1" bal:Overridable="yes" />
<Variable Name="HyperVCheckbox" Type="numeric" Value="0" bal:Overridable="yes" />
<Variable Name="AllowOldWin" Type="numeric" Value="0" bal:Overridable="yes" />
<Variable Name="LaunchTarget" Value="explorer.exe" Type="formatted" />
<Variable Name="LaunchArguments" Value="&quot;[InstallFolder]\podman-for-windows.html&quot;" Type="formatted" />
<Variable Name="SkipConfigFileCreation" Value="0" />

<util:RegistrySearch Id="PreviousVersionSearch" Variable="PreviousVersion" Result="value" Root="HKLM" Key="SOFTWARE\[WixBundleManufacturer]\Updates\[WixBundleName]" Value="PackageVersion"/>
<util:RegistrySearch Id="PreviousInstallFolderSearch" Root="HKLM" Key="SOFTWARE\[WixBundleManufacturer]\[WixBundleName]" Value="InstallDir" Variable="PreviousInstallFolder" Win64="yes"/>
<util:RegistrySearch Id="PreviousVersionSearch" Variable="PreviousVersion" Result="value" Root="HKLM" Key="SOFTWARE\[WixBundleManufacturer]\Updates\[WixBundleName]" Value="PackageVersion" />
<util:RegistrySearch Id="PreviousInstallFolderSearch" Root="HKLM" Key="SOFTWARE\[WixBundleManufacturer]\[WixBundleName]" Value="InstallDir" Variable="PreviousInstallFolder" Bitness="always64" />
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="InstallFolder" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
<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.">
<![CDATA[VersionNT >= v10.0 AND (CBNumber >= 19041 OR AllowOldWin = 1)]]>
</bal:Condition>
<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.">
<![CDATA[WixBundleAction <> 5 OR WixBundleInstalled OR WixBundleForcedRestartPackage OR PreviousVersion <> VERSION]]>
</bal:Condition>
<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 &gt;= v10.0 AND (CBNumber &gt;= 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="WixBundleAction &lt;&gt; 5 OR WixBundleInstalled OR WixBundleForcedRestartPackage OR PreviousVersion &lt;&gt; VERSION" />
<Chain>
<MsiPackage Id="Setup" SourceFile="podman.msi" Vital="yes">
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
<MsiProperty Name="WITH_WSL" Value="[WSLCheckbox]"/>
<MsiProperty Name="MACHINE_PROVIDER" Value="[MachineProvider]" />
<MsiProperty Name="WITH_WSL" Value="[WSLCheckbox]" />
<MsiProperty Name="WITH_HYPERV" Value="[HyperVCheckbox]" />
<MsiProperty Name="SKIP_CONFIG_FILE_CREATION" Value="[SkipConfigFileCreation]" />
</MsiPackage>
<ExePackage DisplayName="WSL Kernel Install" InstallCondition="WSLCheckbox = 1" SourceFile="artifacts\podman-wslkerninst.exe"/>
<ExePackage DisplayName="WSL Kernel Install" InstallCondition="(MachineProvider = &quot;wsl&quot;) AND (WSLCheckbox = 1)" SourceFile="artifacts\podman-wslkerninst.exe" />
</Chain>
<OptionalUpdateRegistration/>
<OptionalUpdateRegistration />
</Bundle>
</Wix>
66 changes: 65 additions & 1 deletion contrib/win-installer/podman-msihooks/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#include <MsiQuery.h>

BOOL isWSLEnabled();
BOOL isHyperVEnabled();
LPCWSTR boolToNStr(BOOL bool);
LPCSTR szSvcNameHyperv = TEXT("vmms");

/**
* CheckWSL is a custom action loaded by the Podman Windows installer
Expand All @@ -28,6 +30,19 @@ LPCWSTR boolToNStr(BOOL bool);
return 0;
}

/**
* CheckHyperV is a custom action loaded by the Podman Windows installer
* to determine whether the system already has Hyper-V installed.
*/

__declspec(dllexport) UINT __cdecl CheckHyperV(MSIHANDLE hInstall) {
BOOL hasHyperV = isHyperVEnabled();
// Set a property with the HyperV state for the installer to operate on
MsiSetPropertyW(hInstall, L"HAS_HYPERVFEATURE", boolToNStr(hasHyperV));

return 0;
}

LPCWSTR boolToNStr(BOOL bool) {
return bool ? L"1" : L"0";
}
Expand All @@ -51,7 +66,7 @@ BOOL isWSLEnabled() {
// CreateProcessW requires lpCommandLine to be mutable
wchar_t cmd[] = L"wsl --set-default-version 2";
if (! CreateProcessW(NULL, cmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE,
NULL, NULL, &startup, &process)) {
NULL, NULL, &startup, &process)) {

return FALSE;
}
Expand All @@ -64,3 +79,52 @@ BOOL isWSLEnabled() {

return exitCode == 0;
}

BOOL isHyperVEnabled() {
/*
* Checks if the Windows service `vmms` is running to
* determine if Hyper-V is enabled.
*/
SC_HANDLE schSCManager;
SC_HANDLE schService;
SERVICE_STATUS_PROCESS ssStatus;
DWORD dwBytesNeeded;

// Get a handle to the SCM database.
schSCManager = OpenSCManager(
NULL, // local computer
NULL, // servicesActive database
SERVICE_QUERY_STATUS); // service query access rights

if (NULL == schSCManager) {
return FALSE;
}

// Get a handle to the service.
schService = OpenService(
schSCManager,
szSvcNameHyperv,
SERVICE_QUERY_STATUS);

if (schService == NULL) {
CloseServiceHandle(schSCManager);
return FALSE;
}

// Check the status
if (!QueryServiceStatusEx(
schService, // handle to service
SC_STATUS_PROCESS_INFO, // information level
(LPBYTE) &ssStatus, // address of structure
sizeof(SERVICE_STATUS_PROCESS), // size of structure
&dwBytesNeeded ) ) {
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);
return FALSE;
}

CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);

return ssStatus.dwCurrentState == SERVICE_RUNNING;
}