Skip to content

Commit 7185d46

Browse files
Merge pull request #25237 from l0rd/stop-automatic-wsl-hyperv-installation
Remove the option to install WSL/HyperV on Windows
2 parents 3967ac2 + 91e4f69 commit 7185d46

File tree

8 files changed

+35
-66
lines changed

8 files changed

+35
-66
lines changed

build_windows.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,12 @@ which include detailed installation information, in the current directory.
356356

357357
Run it in `quiet` mode to automate the installation and avoid interacting with
358358
the GUI. Open the terminal **as an administrator**, add the `/quiet` option, and
359-
set the bundle variables `MachineProvider` (`wsl` or `hyperv`), `WSLCheckbox`
360-
(`1` to install WSL as part of the installation, `0` otherwise), and
361-
`HyperVCheckbox` (`1` to install Hyper-V as part of the installation, `0`
362-
otherwise):
359+
set the bundle variable `MachineProvider` (`wsl` or `hyperv`):
363360

364361
```pwsh
365362
contrib\win-installer\podman-5.1.0-dev-setup.exe /install `
366363
/log podman-setup.log /quiet `
367-
MachineProvider=wsl WSLCheckbox=0 HyperVCheckbox=0
364+
MachineProvider=wsl
368365
```
369366

370367
:information_source: If uninstallation fails, the installer may end up in an
@@ -418,13 +415,11 @@ msiexec /package contrib\win-installer\en-US\podman.msi /l*v podman-msi.log
418415
```
419416

420417
To run it in quiet, non-interactive mode, open the terminal **as an
421-
administrator**, add the `/quiet` option, and set the MSI properties
422-
`MACHINE_PROVIDER` (`wsl` or `hyperv`), `WITH_WSL` (`1` to install WSL as part
423-
of the installation, `0` otherwise) and `WITH_HYPERV` (`1` to install Hyper-V as
424-
part of the installation, `0` otherwise):
418+
administrator**, add the `/quiet` option, and set the MSI property
419+
`MACHINE_PROVIDER` (`wsl` or `hyperv`):
425420

426421
```pwsh
427-
msiexec /package contrib\win-installer\en-US\podman.msi /l*v podman-msi.log /quiet MACHINE_PROVIDER=wsl WITH_WSL=0 WITH_HYPERV=0
422+
msiexec /package contrib\win-installer\en-US\podman.msi /l*v podman-msi.log /quiet MACHINE_PROVIDER=wsl
428423
```
429424

430425
:information_source: `podman.msi` GUI dialogs, defined in the file

contrib/win-installer/burn.wxs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<Variable Name="InstallFolder" Type="formatted" Value="[ProgramFiles64Folder]RedHat\Podman" bal:Overridable="yes" />
1010
<Variable Name="VERSION" Value="$(var.VERSION)" />
1111
<Variable Name="MachineProvider" Type="string" Value="wsl" bal:Overridable="yes" />
12-
<Variable Name="WSLCheckbox" Type="numeric" Value="0" bal:Overridable="yes" />
13-
<Variable Name="HyperVCheckbox" Type="numeric" Value="0" bal:Overridable="yes" />
1412
<Variable Name="AllowOldWin" Type="numeric" Value="0" bal:Overridable="yes" />
1513
<Variable Name="LaunchTarget" Value="explorer.exe" />
1614
<Variable Name="LaunchArguments" Value="&quot;[InstallFolder]\podman-for-windows.html&quot;" />
@@ -31,11 +29,8 @@
3129
<MsiPackage Id="Setup" SourceFile="en-US\podman.msi" Vital="yes">
3230
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
3331
<MsiProperty Name="MACHINE_PROVIDER" Value="[MachineProvider]" />
34-
<MsiProperty Name="WITH_WSL" Value="[WSLCheckbox]" />
35-
<MsiProperty Name="WITH_HYPERV" Value="[HyperVCheckbox]" />
3632
<MsiProperty Name="SKIP_CONFIG_FILE_CREATION" Value="[SkipConfigFileCreation]" />
3733
</MsiPackage>
38-
<ExePackage DisplayName="WSL Kernel Install" InstallCondition="(MachineProvider = &quot;wsl&quot;) AND (WSLCheckbox = 1) AND (NOT PreviousInstallFolder)" SourceFile="artifacts\podman-wslkerninst.exe" DetectCondition="" Permanent="true" />
3934
</Chain>
4035
<OptionalUpdateRegistration />
4136
</Bundle>

contrib/win-installer/podman-theme.wxl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<String Id="InstallMessage" Value="Welcome to the [WixBundleName] [VERSION] setup wizard. This will install [WixBundleName] on your computer." />
1010
<String Id="ProvidersMessage" Value="Additionally, you have the option to select the virtualization provider required by Podman: WSLv2 or Hyper-V.
1111
12-
You can choose to also install the virtualization provider if it is not already enabled. This operation requires a reboot during the installation process. Alternatively, you can deselect the checkbox, and install the virtualization provider manually.
12+
If it's not already installed, you will have to install the virtualization provider manually.
1313
1414
Finally, click install to continue, or Close to abort the installation." />
1515
<String Id="InstallVersion" Value="Version [WixBundleVersion]" />
@@ -27,8 +27,6 @@ Finally, click install to continue, or Close to abort the installation." />
2727
<String Id="HelpCloseButton" Value="&amp;Close" />
2828
<String Id="InstallLicenseLinkText" Value='[WixBundleName] &lt;a href="#"&gt;license terms&lt;/a&gt;.' />
2929
<String Id="InstallAcceptCheckbox" Value="I &amp;agree to the license terms and conditions" />
30-
<String Id="InstallWSLCheckbox" Value="&amp;Install WSLv2 if not present" />
31-
<String Id="InstallHypervCheckbox" Value="&amp;Install Hyper-V if not present" />
3230
<String Id="InstallInstallButton" Value="&amp;Install" />
3331
<String Id="InstallCancelButton" Value="&amp;Close" />
3432
<String Id="OptionsHeader" Value="Setup Options" />

contrib/win-installer/podman-theme.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
</RadioButtons>
4040
<Hypertext Name="EulaHyperlink" X="185" Y="-111" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
4141
<Label Name="InstallVersion" X="510" Y="-50" Width="-11" Height="17" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBAShowVersion">#(loc.InstallVersion)</Label>
42-
<Checkbox Name="WSLCheckbox" VisibleCondition="(MachineProvider = &quot;wsl&quot;) AND (NOT PreviousInstallFolder)" X="185" Y="320" Width="-11" Height="17" TabStop="yes" FontId="6" HideWhenDisabled="yes">#(loc.InstallWSLCheckbox)</Checkbox>
43-
<Checkbox Name="HyperVCheckbox" VisibleCondition="(MachineProvider = &quot;hyperv&quot;) AND (NOT PreviousInstallFolder)" X="185" Y="320" Width="-11" Height="17" TabStop="yes" FontId="6" HideWhenDisabled="yes">#(loc.InstallHypervCheckbox)</Checkbox>
4442
<Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" VisibleCondition="NOT WixStdBASuppressOptionsUI">
4543
<Text>#(loc.InstallOptionsButton)</Text>
4644
<ChangePageAction Page="Options" />

contrib/win-installer/podman.wxs

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,6 @@
3434
</DirectorySearch>
3535
</Property>
3636

37-
<!--
38-
Property WSL_INSTALL is set at runtime and used as the condition to run the `WSLFeatureComponent` Component:
39-
WSL is installed only if all these conditions are met:
40-
- WSL isn't already installed
41-
- The user has set property `MACHINE_PROVIDER` to "wsl"
42-
- The user hasn't set property `WITH_WSL` to 0
43-
-->
44-
<SetProperty Id="WSL_INSTALL" Before="AppSearch" Value="1" Sequence="first" Condition="(HAS_WSLFEATURE = 0) AND (MACHINE_PROVIDER = &quot;wsl&quot;) AND (NOT (WITH_WSL = 0))" />
45-
<!--
46-
Property HYPERV_INSTALL is set at runtime and used as the condition to run the `HyperVFeatureComponent` Component:
47-
HyperV is installed only if all these conditions are met:
48-
- HyperV isn't already installed
49-
- The user has set property `MACHINE_PROVIDER` to "hyperv"
50-
- The user hasn't set property `WITH_HYPERV` to 0
51-
-->
52-
<SetProperty Id="HYPERV_INSTALL" Before="AppSearch" Value="1" Sequence="first" Condition="(HAS_HYPERVFEATURE = 0) AND (MACHINE_PROVIDER = &quot;hyperv&quot;) AND (NOT (WITH_HYPERV = 0))" />
5337
<!--
5438
Property CREATE_MACHINE_PROVIDER_CONFIG_FILE is set at runtime and used as the condition to run the `MachineProviderConfigFile` Component:
5539
The machine provider config file is created (or is not deleted if it already exist) if these conditions are met:
@@ -71,19 +55,6 @@
7155
<CustomAction Id="CheckWSL" Execute="firstSequence" DllEntry="CheckWSL" BinaryRef="PodmanHooks" />
7256
<CustomAction Id="CheckHyperV" Execute="firstSequence" DllEntry="CheckHyperV" BinaryRef="PodmanHooks" />
7357
<util:BroadcastEnvironmentChange />
74-
<ComponentGroup Id="WSLFeature" Directory="INSTALLDIR">
75-
<Component Id="WSLFeatureComponent" Guid="F6A693BC-186C-4E64-8015-C3073013B3A8" Condition="(NOT Installed) AND (WSL_INSTALL = 1)">
76-
<CreateFolder />
77-
<PanelSW:Dism EnableFeature="VirtualMachinePlatform" ErrorHandling="prompt" />
78-
<PanelSW:Dism EnableFeature="Microsoft-Windows-Subsystem-Linux" ErrorHandling="prompt" />
79-
</Component>
80-
</ComponentGroup>
81-
<ComponentGroup Id="HyperVFeature" Directory="INSTALLDIR">
82-
<Component Id="HyperVFeatureComponent" Guid="F7B2D4C9-6C89-46BB-B4EA-FF39424972F3" Condition="(NOT Installed) AND (HYPERV_INSTALL = 1)">
83-
<CreateFolder />
84-
<PanelSW:Dism EnableFeature="Microsoft-Hyper-V" ErrorHandling="prompt" />
85-
</Component>
86-
</ComponentGroup>
8758
<Feature Id="Complete" Level="1">
8859
<ComponentRef Id="INSTALLDIR_Component" />
8960
<ComponentRef Id="EnvEntriesComponent" />
@@ -94,8 +65,6 @@
9465
<?endif?>
9566
<ComponentRef Id="GuideHTMLComponent" />
9667
<ComponentGroupRef Id="ManFiles" />
97-
<ComponentGroupRef Id="WSLFeature" />
98-
<ComponentGroupRef Id="HyperVFeature" />
9968
</Feature>
10069
<Feature Id="MachineProviderConfig" Level="1">
10170
<ComponentRef Id="MachineProviderConfigFile" />
@@ -114,9 +83,8 @@
11483
</UI>
11584

11685
<InstallExecuteSequence>
117-
<Custom Action="CheckWSL" Before="SetWSL_INSTALL" />
118-
<Custom Action="CheckHyperV" Before="SetHYPERV_INSTALL" />
119-
<ForceReboot After="DismX86" Condition="(NOT Installed) AND (NOT UpdateStarted) AND (NOT BURNMSIUNINSTALL) AND ((WSL_INSTALL = 1) OR (HYPERV_INSTALL = 1)) AND (NOT AFTERREBOOT)" />
86+
<Custom Action="CheckWSL" Before="InstallFiles" />
87+
<Custom Action="CheckHyperV" Before="InstallFiles" />
12088
</InstallExecuteSequence>
12189
<Binary Id="PodmanHooks" SourceFile="artifacts/podman-msihooks.dll" />
12290

contrib/win-installer/test-installer.ps1

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# .\winmake.ps1 installer 9.9.9 &&
1010
# .\contrib\win-installer\test-installer.ps1 `
1111
# -scenario all `
12-
# -previousSetupExePath ".\contrib\win-installer\podman-5.3.0-dev-setup.exe" `
1312
# -setupExePath ".\contrib\win-installer\podman-5.4.0-dev-setup.exe" `
1413
# -nextSetupExePath ".\contrib\win-installer\podman-9.9.9-dev-setup.exe" `
1514
# -provider hyperv
@@ -32,8 +31,6 @@ param (
3231
[string]$nextSetupExePath,
3332
[ValidateSet("wsl", "hyperv")]
3433
[string]$provider="wsl",
35-
[switch]$installWSL=$false,
36-
[switch]$installHyperV=$false,
3734
[switch]$skipWinVersionCheck=$false,
3835
[switch]$skipConfigFileCreation=$false
3936
)
@@ -53,19 +50,15 @@ function Install-Podman {
5350
[ValidateScript({Test-Path $_ -PathType Leaf})]
5451
[string]$setupExePath
5552
)
56-
if ($installWSL) {$wslCheckboxVar = "1"} else {$wslCheckboxVar = "0"}
57-
if ($installHyperV) {$hypervCheckboxVar = "1"} else {$hypervCheckboxVar = "0"}
5853
if ($skipWinVersionCheck) {$allowOldWinVar = "1"} else {$allowOldWinVar = "0"}
5954
if ($skipConfigFileCreation) {$skipConfigFileCreationVar = "1"} else {$skipConfigFileCreationVar = "0"}
6055

6156
Write-Host "Running the installer ($setupExePath)..."
62-
Write-Host "(provider=`"$provider`", WSLCheckbox=`"$wslCheckboxVar`", HyperVCheckbox=`"$hypervCheckboxVar`", AllowOldWin=`"$allowOldWinVar`", SkipConfigFileCreation=`"$skipConfigFileCreationVar`")"
57+
Write-Host "(provider=`"$provider`", AllowOldWin=`"$allowOldWinVar`", SkipConfigFileCreation=`"$skipConfigFileCreationVar`")"
6358
$ret = Start-Process -Wait `
6459
-PassThru "$setupExePath" `
6560
-ArgumentList "/install /quiet `
6661
MachineProvider=${provider} `
67-
WSLCheckbox=${wslCheckboxVar} `
68-
HyperVCheckbox=${hypervCheckboxVar} `
6962
AllowOldWin=${allowOldWinVar} `
7063
SkipConfigFileCreation=${skipConfigFileCreationVar} `
7164
/log $PSScriptRoot\podman-setup.log"

contrib/win-installer/welcome-install-dlg.wxs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
<RadioButton Text="Windows Linux Subsystem (WSLv2)" Height="15" Value="wsl" Width="226" X="10" Y="0" />
1313
<RadioButton Text="Windows Hyper-V" Height="15" Value="hyperv" Width="226" X="10" Y="15" />
1414
</RadioButtonGroup>
15-
1615
</Control>
17-
<Control Id="WSLInstallCheckbox" Type="CheckBox" X="135" Y="190" Width="226" Height="18" CheckBoxValue="1" Property="WSL_INSTALL" Default="no" Text="Install WSL if needed (requires reboot)" ShowCondition="MACHINE_PROVIDER = &quot;wsl&quot;" HideCondition="(MACHINE_PROVIDER = &quot;hyperv&quot; OR HIDE_PROVIDER_CHOICE) OR (HAS_WSLFEATURE = 1)" />
18-
<Control Id="HyperVInstallCheckbox" Type="CheckBox" X="135" Y="190" Width="226" Height="18" CheckBoxValue="1" Property="HYPERV_INSTALL" Default="no" Text="Install Hyper-V if needed (requires reboot)" ShowCondition="MACHINE_PROVIDER = &quot;hyperv&quot;" HideCondition="(MACHINE_PROVIDER = &quot;wsl&quot; OR HIDE_PROVIDER_CHOICE) OR (HAS_HYPERVFEATURE = 1)" />
1916
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
2017
<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.WelcomeEulaDlgInstall)">
2118
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg" Condition="!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1" />

winmake.ps1

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,32 @@ function Podman-Remote{
1616
}
1717

1818
function Make-Clean{
19-
Remove-Item ./bin -Recurse -Force -Confirm:$false
19+
$paths= @(
20+
# Files generated by the `podman` target
21+
"$PSScriptRoot\bin\windows"
22+
# Files generated by the `installer` target
23+
"$PSScriptRoot\test\version\version.exe"
24+
"$PSScriptRoot\contrib\win-installer\artifacts"
25+
"$PSScriptRoot\contrib\win-installer\current"
26+
"$PSScriptRoot\contrib\win-installer\docs"
27+
"$PSScriptRoot\contrib\win-installer\en-us"
28+
"$PSScriptRoot\contrib\win-installer\fetch"
29+
"$PSScriptRoot\contrib\win-installer\obj"
30+
"$PSScriptRoot\contrib\win-installer\*.log"
31+
"$PSScriptRoot\contrib\win-installer\*.exe"
32+
"$PSScriptRoot\contrib\win-installer\*.wixpdb"
33+
# Files generated by the Documentation target
34+
"$PSScriptRoot\docs\build\remote\podman-*.html"
35+
"$PSScriptRoot\docs\build\remote\podman-for-windows.html"
36+
)
37+
38+
foreach ($path in $paths) {
39+
if (Test-Path -Path $path -PathType Container) {
40+
Remove-Item $path -Recurse -Force -Confirm:$false
41+
} elseif (Test-Path -Path $path -PathType Leaf) {
42+
Remove-Item $path -Force -Confirm:$false
43+
}
44+
}
2045
}
2146

2247
function Local-Machine {

0 commit comments

Comments
 (0)