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

Windows installer: Add option to add to *system* PATH in admin install mode #4495

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

kinke
Copy link
Member

@kinke kinke commented Sep 16, 2023

Resolves #4494.

@schveiguy
Copy link
Contributor

Is there a way I can test (with built artifacts)? Happy to prove it works or not.

@kinke
Copy link
Member Author

kinke commented Sep 17, 2023

That'd be awesome, as that's the missing part - I've just blindly added some (Delphi...) code so far.

I believe you should be able to download the windows-multilib artifacts from https://github.com/ldc-developers/ldc/actions/runs/6208013760?pr=4495, which should include the .exe Windows installer.

@@ -16,7 +16,7 @@ AppVerName=LDC {#LDCVersion}
ArchitecturesAllowed=x64
; Enable /CURRENTUSER cmdline option to install for current user only, requiring no admin privileges.
; This affects the default install dir (override with /DIR="x:\dirname") and the registry root key (HKCU, not HKLM).
PrivilegesRequiredOverridesAllowed=commandline
PrivilegesRequiredOverridesAllowed=dialog
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://jrsoftware.org/ishelp/index.php?topic=setup_privilegesrequiredoverridesallowed, this should retain the CLI option but also ask whether an admin or local-user-only install should be performed.

@@ -40,7 +40,8 @@ Name: lib32; Description: "x86 libraries"; Types: full

[Run]
; note: not added to PATH for silent installs with /SILENT or /VERYSILENT
Filename: "{cmd}"; Parameters: "/c echo hello"; Check: not IsInEnvPath; BeforeInstall: AddToEnvPath; Description: "Add to PATH environment variable for current user"; Flags: postinstall skipifsilent runhidden nowait
Filename: "{cmd}"; Parameters: "/c echo hello"; Check: not IsInUserEnvPath; BeforeInstall: AddToUserEnvPath; Description: "Add to PATH environment variable for current user"; Flags: postinstall skipifsilent runhidden nowait
Filename: "{cmd}"; Parameters: "/c echo hello"; Check: IsAdminInstallMode and not IsInSystemEnvPath; BeforeInstall: AddToSystemEnvPath; Description: "Add to system PATH environment variable"; Flags: postinstall skipifsilent runhidden nowait unchecked
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be unchecked by default and only visible in admin install mode.

@schveiguy
Copy link
Contributor

Tested this out:

  1. The switch to a dialog instead of a command line switch is great! I tested installing for the local user and it works exactly as designed. Technically this fixes the issue I was having but...
  2. The checkbox for adding to the system path doesn't seem to work. I tried both with both boxes checked (local user and system path), and just the system path checked. Neither one adds to system environment variables.

I'll look and see if I can figure out which Key needs setting.

@schveiguy
Copy link
Contributor

Just tested the updated artifact, and works as designed. Thanks!

@kinke
Copy link
Member Author

kinke commented Sep 18, 2023

Perfect, thank you!

@kinke kinke marked this pull request as ready for review September 18, 2023 14:39
@kinke kinke merged commit 04e1064 into ldc-developers:master Sep 18, 2023
21 checks passed
@kinke kinke deleted the win_installer_syspath branch September 18, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows installer installs to Administrator path when installed from limited user
2 participants