Skip to content

Commit

Permalink
don't allow adding to $env:PATH for user installs
Browse files Browse the repository at this point in the history
  • Loading branch information
guijan committed Jan 2, 2025
1 parent 07e4a45 commit d0dba7c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/dictpw.iss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ ChangesEnvironment=WizardIsTaskSelected('stationary\env_path')
Name: stationary; \
Description: "Stationary Installation (creates registry entries and uninstaller)"; \
Flags: exclusive checkablealone
Name: stationary\env_path; Description: "Add to $env:PATH"
; Make sure this stays the 2nd entry so its index is 1 later.
Name: stationary\env_path; Description: "Add to $env:PATH (needs admin install)"
; "portable" is just a marker and never used
Name: portable; \
Description: "Portable Installation (no registry entries and no uninstaller)"; \
Expand Down Expand Up @@ -99,6 +100,15 @@ Root: HKLM; \
Tasks: stationary\env_path

[code]
procedure CurPageChanged(CurPageID: Integer);
begin
{ Don't add to $env:PATH for user installs. }
if (CurPageID = wpSelectTasks) and not IsAdminInstallMode() then
begin
WizardSelectTasks('!stationary\env_path')
WizardForm.TasksList.ItemEnabled[1] := false
end;
end;
Function ShouldIAddToPATH(Path: string): boolean;
var
PathList: string;
Expand Down

0 comments on commit d0dba7c

Please sign in to comment.