podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

chore: set oneClick false and perMachine false in nsis

Open cdrage opened this issue 5 months ago • 3 comments

chore: set oneClick false and perMachine false in nsis

What does this PR do?

This PR updates the NSIS installer settings to:

  • oneClick: false
  • perMachine: false

The result is that clicking on the .exe to install there is no change (we do not have an "interactive" installation anyways, so onClick despite it being set to true by default doe snot apply).

However, you can now use /ALLUSERS on the command line to successfully install to all users.

Why this is required:

Electron-Builder’s NSIS logic combines the two flags as shown below.

oneClick perMachine Interactive UI scope Silent /S scope /ALLUSERS respected?
true false Always per-user (silent) Per-user No
true true Always per-machine (silent) Per-machine No (forced machine)
false true Wizard, forces admin install Per-machine Yes, but no per-user
false false Wizard, defaults per-user Per-user or per-machine (when /ALLUSERS) Yes

We now set it to both false, allowing us to have both combinations (single user install, and CLI install to all users).

Screenshot / video of UI

N/A

What issues does this PR fix or reference?

Closes https://github.com/podman-desktop/podman-desktop/issues/12734

How to test this PR?

Confirming that it installs for all users:

  1. Run pnpm build and pnpm compile on a WINDOWS MACHINE.

  2. Run the following using the installer:

cd dist/
./podman-desktop-installer.exe /S /ALLUSERS
  1. Confirm that it is installed SYSTEM WIDE in C:/Program Files/Podman Desktop

Confirming it installs regularly:

  1. Run pnpm build and pnpm compile on a WINDOWS MACHINE.

  2. Run the installer (dist/podman-desktop-installer.exe) as normal

  3. See it installs to %AppData% correctly.

Signed-off-by: Charlie Drage [email protected]

cdrage avatar Jun 23 '25 16:06 cdrage

@benoitf @deboer-tim @cbr7

I did extensive testing on Windows to get this to work with a bunch of different build combinations, and found this to be the one that covers both cases.

However.. IMO, we need extensive QE testing / maybe an e2e test added to test single user install vs system wide.

Should we open up another issue to add QE / playwright tests?

cdrage avatar Jun 23 '25 16:06 cdrage

Hello @cdrage! I've just finished testing the PR on windows. These are my results:

  • Running the installer with /ALLUSERS (./podman-desktop-1.20.0-next-setup-x64.exe /s /ALLUSERS) installs PD on C:/Program Files (works as expected)
  • Running the installer without /ALLUSERS (./podman-desktop-1.20.0-next-setup-x64.exe /s) installs PD on C:\Users[user]\AppData\Local\Programs\Podman Desktop, not on %ProgramData% (C:\ProgramData). I think this is expected, did you write the wrong path on the issue?

Also, a new issue to cover the feature in an E2E test case has been opened: https://github.com/podman-desktop/e2e/issues/371

danivilla9 avatar Jun 26 '25 11:06 danivilla9

Hello @cdrage! I've just finished testing the PR on windows. These are my results:

  • Running the installer with /ALLUSERS (./podman-desktop-1.20.0-next-setup-x64.exe /s /ALLUSERS) installs PD on C:/Program Files (works as expected)
  • Running the installer without /ALLUSERS (./podman-desktop-1.20.0-next-setup-x64.exe /s) installs PD on C:\Users[user]\AppData\Local\Programs\Podman Desktop, not on %ProgramData% (C:\ProgramData). I think this is expected, did you write the wrong path on the issue?

Also, a new issue to cover the feature in an E2E test case has been opened: podman-desktop/e2e#371

I apologize, I meant %AppData%, bit of a brain fart! Not %ProgramData% (see docs: https://podman-desktop.io/docs/uninstall that we use %AppData%)

Thanks for testing this out :)

cdrage avatar Jun 26 '25 12:06 cdrage

@cdrage merge ?

benoitf avatar Jun 27 '25 15:06 benoitf

@cdrage merge ?

Sure. Tests pass, e2e tested it, three other approvals.

Hopefully in the future we also have the e2e test.

Thanks for reviewing!

cdrage avatar Jun 27 '25 20:06 cdrage

@benoitf Can we update the choco package so that it includes the /ALLUSERS switch (e.g. opt in)?

We use DSC to push out our packages, and we strongly prefer machine wide installation.

Edit* The workaround for now is

cChocoPackageInstaller PodmanDesktop {
  Name        = "podman-desktop"
  ChocoParams = '--install-arguments="/s /ALLUSERS"'
  DependsOn   = "[Script]InstallChocolatey", "[Service]DockerEngineService"
}

Cheers, Indy

indy-singh avatar Aug 04 '25 21:08 indy-singh