Skip to content

Commit 14443b6

Browse files
committed
windows-installer: Default to a user-writable directory for non-admin installs
1 parent 81169c6 commit 14443b6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

script/windows-installer/inno-setup-git-lfs-installer.iss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AppVersion={#MyAppVersion}
2525
ArchitecturesInstallIn64BitMode=x64
2626
ChangesEnvironment=yes
2727
Compression=lzma
28-
DefaultDirName={pf}\{#MyAppName}
28+
DefaultDirName={code:GetDefaultDirName}
2929
DirExistsWarning=no
3030
DisableReadyPage=True
3131
LicenseFile=..\..\LICENSE.md
@@ -56,6 +56,15 @@ Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environmen
5656
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "GIT_LFS_PATH"; ValueData: "{app}"
5757

5858
[Code]
59+
function GetDefaultDirName(Dummy: string): string;
60+
begin
61+
if IsAdminLoggedOn then begin
62+
Result:=ExpandConstant('{pf}\{#MyAppName}');
63+
end else begin
64+
Result:=ExpandConstant('{userpf}\{#MyAppName}');
65+
end;
66+
end;
67+
5968
// Uses cmd to parse and find the location of Git through the env vars.
6069
// Currently only used to support running the uninstaller for the old Git LFS version.
6170
function GetExistingGitInstallation(Value: string): string;

0 commit comments

Comments
 (0)