Skip to content

Commit 6325aaf

Browse files
authored
Merge pull request git-lfs#1966 from git-lfs/windows-no-admin
Allow non-admin installations on Windows
2 parents 43cad0b + 098cd07 commit 6325aaf

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@
1414
; NOTE: The value of AppId uniquely identifies this application.
1515
; Do not use the same AppId value in installers for other applications.
1616
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
17+
AppCopyright=GitHub, Inc. and Git LFS contributors
1718
AppId={{286391DE-F778-44EA-9375-1B21AAA04FF0}
1819
AppName={#MyAppName}
19-
AppVersion={#MyAppVersion}
20-
AppCopyright=GitHub, Inc. and Git LFS contributors
2120
AppPublisher={#MyAppPublisher}
2221
AppPublisherURL={#MyAppURL}
2322
AppSupportURL={#MyAppURL}
2423
AppUpdatesURL={#MyAppURL}
24+
AppVersion={#MyAppVersion}
25+
ArchitecturesInstallIn64BitMode=x64
26+
ChangesEnvironment=yes
27+
Compression=lzma
28+
DefaultDirName={code:GetDefaultDirName}
29+
DirExistsWarning=no
30+
DisableReadyPage=True
2531
LicenseFile=..\..\LICENSE.md
2632
OutputBaseFilename={#MyAppFilePrefix}-{#MyAppVersion}
2733
OutputDir=..\..\
28-
Compression=lzma
34+
PrivilegesRequired=none
35+
SetupIconFile=git-lfs-logo.ico
2936
SolidCompression=yes
30-
DefaultDirName={pf}\{#MyAppName}
3137
UsePreviousAppDir=no
32-
DirExistsWarning=no
33-
DisableReadyPage=True
34-
ArchitecturesInstallIn64BitMode=x64
35-
ChangesEnvironment=yes
36-
SetupIconFile=git-lfs-logo.ico
3738
VersionInfoVersion={#MyVersionInfoVersion}
3839
WizardImageFile=git-lfs-wizard-image.bmp
3940
WizardSmallImageFile=git-lfs-logo.bmp
@@ -51,10 +52,21 @@ Source: ..\..\git-lfs-x64.exe; DestDir: "{app}"; Flags: ignoreversion; DestName:
5152
Source: ..\..\git-lfs-x86.exe; DestDir: "{app}"; Flags: ignoreversion; DestName: "git-lfs.exe"; AfterInstall: InstallGitLFS; Check: not Is64BitInstallMode
5253

5354
[Registry]
54-
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath('{app}')
55-
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "GIT_LFS_PATH"; ValueData: "{app}"
55+
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: IsAdminLoggedOn and NeedsAddPath('{app}')
56+
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "GIT_LFS_PATH"; ValueData: "{app}"; Check: IsAdminLoggedOn
57+
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: (not IsAdminLoggedOn) and NeedsAddPath('{app}')
58+
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "GIT_LFS_PATH"; ValueData: "{app}"; Check: not IsAdminLoggedOn
5659

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

0 commit comments

Comments
 (0)