Skip to content

Commit 804ad4e

Browse files
Merge pull request #26023 from l0rd/win-installer-remove-provider-check
Remove providers checks from the Windows Installer
2 parents 7800db6 + 9c5f766 commit 804ad4e

File tree

6 files changed

+19
-240
lines changed

6 files changed

+19
-240
lines changed

build_windows.md

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Windows.
1111
- [Git and go](#git-and-go)
1212
- [Pandoc](#pandoc)
1313
- [.NET SDK](#net-sdk)
14-
- [Visual Studio Build Tools](#visual-studio-build-tools)
1514
- [Virtualization Provider](#virtualization-provider)
1615
- [WSL](#wsl)
1716
- [Hyper-V](#hyper-v)
@@ -90,30 +89,6 @@ used too and can be installed using `dotnet install`:
9089
dotnet tool install --global wix
9190
```
9291

93-
### Visual Studio Build Tools
94-
95-
The installer includes a C program that checks the installation of the
96-
pre-required virtualization providers (WSL or Hyper-V). Building this program
97-
requires the
98-
[Microsoft C/C++ compiler](https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170) and the
99-
[PowerShell Module VSSetup](https://github.com/microsoft/vssetup.powershell):
100-
101-
1. Download the Build Tools for Visual Studio 2022 installer
102-
```pwsh
103-
Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_BuildTools.exe' -OutFile "$env:TEMP\vs_BuildTools.exe"
104-
```
105-
2. Run the installer with the parameter to include the optional C/C++ Tools
106-
```pwsh
107-
& "$env:TEMP\vs_BuildTools.exe" --passive --wait `
108-
--add Microsoft.VisualStudio.Workload.VCTools `
109-
--includeRecommended `
110-
--remove Microsoft.VisualStudio.Component.VC.CMake.Project
111-
```
112-
3. Install the PowerShell Module VSSetup
113-
```pwsh
114-
Install-Module VSSetup
115-
```
116-
11792
### Virtualization Provider
11893

11994
Running Podman on Windows requires a virtualization provider. The supported
@@ -314,8 +289,7 @@ To learn how to use the Podman client, refer to its
314289
## Build and test the Podman Windows installer
315290

316291
The Podman Windows installer (e.g., `podman-5.1.0-dev-setup.exe`) is a bundle
317-
that includes an msi package (`podman.msi`) and installs the WSL kernel
318-
(`podman-wslkerninst.exe`). It's built using the
292+
that includes an msi package (`podman.msi`). It's built using the
319293
[WiX Toolset](https://wixtoolset.org/) and the
320294
[PanelSwWixExtension](https://github.com/nirbar/PanelSwWixExtension/tree/master5)
321295
WiX extension. The source code is in the folder `contrib\win-installer`.
@@ -336,9 +310,6 @@ root) with a name like `podman-5.2.0-dev-setup.exe`.
336310

337311
The `installer` target of `winmake.ps1` runs the script
338312
`contrib\win-installer\build.ps1` that, in turns, executes:
339-
340-
- `build-hooks.bat`: builds `podman-wslkerninst.exe` (WSL kernel installer) and
341-
`podman-msihooks.dll` (helper that checks if WSL and Hyper-V are installed).
342313
- `dotnet build podman.wixproj`: builds `podman.msi` from the WiX source files `podman.wxs`,
343314
`pages.wxs`, `podman-ui.wxs` and `welcome-install-dlg.wxs`.
344315
- `dotnet build podman-setup.wixproj`: builds `podman-setup.exe` file from
@@ -521,7 +492,13 @@ tools:
521492
[`.pre-commit-config.yaml`](.pre-commit-config.yaml)
522493

523494
:information_source: Install [golangci-lint](https://golangci-lint.run) and
524-
[pre-commit](https://pre-commit.com) to run `winmake.ps1 lint`.
495+
[pre-commit](https://pre-commit.com) to run `winmake.ps1 lint`:
496+
```pwsh
497+
winget install -e golangci-lint.golangci-lint
498+
winget install -e Python.Python.3.13
499+
pip install pre-commit
500+
```
501+
525502

526503
### winmake validatepr
527504

contrib/win-installer/build-hooks.ps1

Lines changed: 0 additions & 67 deletions
This file was deleted.

contrib/win-installer/build.ps1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,8 @@ if ($ENV:INSTVER -eq "") {
103103
Exit 1
104104
}
105105

106-
.\build-hooks.ps1; ExitOnError
107106
SignItem @("artifacts/win-sshproxy.exe",
108-
"artifacts/podman.exe",
109-
"artifacts/podman-msihooks.dll",
110-
"artifacts/podman-wslkerninst.exe")
107+
"artifacts/podman.exe")
111108
$gvExists = Test-Path "artifacts/gvproxy.exe"
112109
if ($gvExists) {
113110
SignItem @("artifacts/gvproxy.exe")

contrib/win-installer/podman-msihooks/check.c

Lines changed: 0 additions & 130 deletions
This file was deleted.

contrib/win-installer/podman.wxs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
<SetProperty Id="HIDE_PROVIDER_CHOICE" After="AppSearch" Value="1" Sequence="first" Condition="(SKIP_CONFIG_FILE_CREATION = 1) OR (MACHINE_PROVIDER_CONFIG_FILE_PATH) OR (MAIN_EXECUTABLE_FILE_PATH)" />
5353

5454
<CustomAction Id="OpenGuide" DllEntry="WixShellExec" Impersonate="yes" BinaryRef="Wix4UtilCA_X86" />
55-
<CustomAction Id="CheckWSL" Execute="firstSequence" DllEntry="CheckWSL" BinaryRef="PodmanHooks" />
56-
<CustomAction Id="CheckHyperV" Execute="firstSequence" DllEntry="CheckHyperV" BinaryRef="PodmanHooks" />
5755
<util:BroadcastEnvironmentChange />
5856
<Feature Id="Complete" Level="1">
5957
<ComponentRef Id="INSTALLDIR_Component" />
@@ -82,12 +80,6 @@
8280
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="OpenGuide" Condition="(WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1) AND (NOT Installed) AND (NOT UpdateStarted)" />
8381
</UI>
8482

85-
<InstallExecuteSequence>
86-
<Custom Action="CheckWSL" Before="InstallFiles" />
87-
<Custom Action="CheckHyperV" Before="InstallFiles" />
88-
</InstallExecuteSequence>
89-
<Binary Id="PodmanHooks" SourceFile="artifacts/podman-msihooks.dll" />
90-
9183
<StandardDirectory Id="ProgramFiles6432Folder">
9284
<Directory Id="RedHatPFiles" Name="RedHat">
9385
<Directory Id="INSTALLDIR" Name="Podman">

winmake.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,20 @@ function Test-Installer{
147147
Exit 1
148148
}
149149

150+
$nextSetupExePath = "$PSScriptRoot\contrib\win-installer\podman-9.9.9-dev-setup.exe"
151+
if (!(Test-Path -Path $nextSetupExePath -PathType Leaf)) {
152+
Write-Host "The automated tests include testing the upgrade from current version to a future version."
153+
Write-Host "That requires a version 9.9.9 of the installer:"
154+
Write-Host " .\winmake.ps1 installer 9.9.9"
155+
Write-Host "Build it and retry running installertest."
156+
Exit 1
157+
}
158+
150159
$command = "$PSScriptRoot\contrib\win-installer\test-installer.ps1"
151160
$command += " -scenario all"
152161
$command += " -provider $provider"
153162
$command += " -setupExePath $setupExePath"
163+
$command += " -nextSetupExePath $nextSetupExePath"
154164
Run-Command "${command}"
155165
}
156166

0 commit comments

Comments
 (0)