1
- ; This script requires Inno Setup Compiler 5.6.1 or later to compile
1
+ ; This script requires Inno Setup Compiler 6.0.0 or later to compile
2
2
; The Inno Setup Compiler (and IDE) can be found at http://www.jrsoftware.org/isinfo.php
3
3
; General documentation on how to use InnoSetup scripts: http://www.jrsoftware.org/ishelp/index.php
4
4
5
5
; Ensure minimum Inno Setup tooling version
6
- #if VER < EncodeVer(5 , 6 , 1 )
7
- #error Update your Inno Setup version (5.6 . 1 or newer)
6
+ #if VER < EncodeVer(6 , 0 , 0 )
7
+ #error Update your Inno Setup version (6.0 . 0 or newer)
8
8
#endif
9
9
10
10
#ifndef PayloadDir
11
11
#error Payload directory path property ' PayloadDir' must be specified
12
12
#endif
13
13
14
- #ifnexist PayloadDir + " \git-credential-manager-core.exe"
15
- #error Payload files are missing
14
+ #ifndef InstallTarget
15
+ #error Installer target property ' InstallTarget' must be specifed
16
+ #endif
17
+
18
+ #if InstallTarget == " user"
19
+ #define GcmAppId " {{aa76d31d-432c-42ee-844c-bc0bc801cef3}}"
20
+ #define GcmLongName " Git Credential Manager Manager Core (User)"
21
+ #define GcmSetupExe " gcmcoreuser"
22
+ #define GcmConfigureCmdArgs " --user"
23
+ #elif InstallTarget == " system"
24
+ #define GcmAppId " {{fdfae50a-1bc1-4ead-9228-1e1c275e8d12}}"
25
+ #define GcmLongName " Git Credential Manager Manager Core"
26
+ #define GcmSetupExe " gcmcore"
27
+ #define GcmConfigureCmdArgs " --system"
28
+ #else
29
+ #error Installer target property ' InstallTarget' must be ' user' or ' system'
16
30
#endif
17
31
18
32
; Define core properties
19
- #define GcmName " Git Credential Manager Core"
33
+ #define GcmShortName " Git Credential Manager Core"
20
34
#define GcmPublisher " Microsoft Corporation"
21
35
#define GcmPublisherUrl " https://www.microsoft.com"
22
- #define GcmCopyright " Copyright (c) Microsoft 2019 "
23
- #define GcmUrl " https://github.com/microsoft/Git-Credential-Manager-Core "
36
+ #define GcmCopyright " Copyright (c) Microsoft 2020 "
37
+ #define GcmUrl " https://aka.ms/gcmcore "
24
38
#define GcmReadme " https://github.com/microsoft/Git-Credential-Manager-Core/blob/master/README.md"
25
39
#define GcmRepoRoot " ..\..\.."
26
40
#define GcmAssets GcmRepoRoot + " \assets"
41
+ #define GcmExe " git-credential-manager-core.exe"
42
+ #define GcmArch " x86"
43
+
44
+ #ifnexist PayloadDir + " \" + GcmExe
45
+ #error Payload files are missing
46
+ #endif
27
47
28
48
; Generate the GCM version version from the CLI executable
29
49
#define VerMajor
30
50
#define VerMinor
31
51
#define VerBuild
32
52
#define VerRevision
33
- #expr ParseVersion(PayloadDir + " \git-credential-manager-core.exe " , VerMajor, VerMinor, VerBuild, VerRevision)
53
+ #expr ParseVersion(PayloadDir + " \" + GcmExe , VerMajor, VerMinor, VerBuild, VerRevision)
34
54
#define GcmVersion str(VerMajor) + " ." + str(VerMinor) + " ." + str(VerBuild) + " ." + str(VerRevision)
35
55
36
56
[Setup]
37
- AppId = {{fdfae50a-1bc1-4ead- 9228 -1e1c275e8d12} }
38
- AppName = {#GcmName }
57
+ AppId = {#GcmAppId }
58
+ AppName = {#GcmLongName }
39
59
AppVersion = {#GcmVersion}
40
- AppVerName = {#GcmName } {#GcmVersion}
60
+ AppVerName = {#GcmLongName } {#GcmVersion}
41
61
AppPublisher = {#GcmPublisher}
42
62
AppPublisherURL = {#GcmPublisherUrl}
43
63
AppSupportURL = {#GcmUrl}
@@ -47,20 +67,23 @@ AppCopyright={#GcmCopyright}
47
67
AppReadmeFile = {#GcmReadme}
48
68
VersionInfoVersion = {#GcmVersion}
49
69
LicenseFile = {#GcmRepoRoot}\LICENSE
50
- OutputBaseFilename = gcmcore -win-x86 -{#GcmVersion}
51
- DefaultDirName = {pf } \{#GcmName }
70
+ OutputBaseFilename = {#GcmSetupExe} -win-{#GcmArch} -{#GcmVersion}
71
+ DefaultDirName = {autopf }\{#GcmShortName }
52
72
Compression = lzma2
53
73
SolidCompression = yes
54
74
MinVersion = 6.1 .7600
55
75
DisableDirPage = yes
56
- UninstallDisplayIcon = {app} \git-credential-manager-core.exe
76
+ UninstallDisplayIcon = {app} \{#GcmExe}
57
77
SetupIconFile = {#GcmAssets}\gcmicon.ico
58
78
WizardImageFile = {#GcmAssets}\gcmicon128.bmp
59
79
WizardSmallImageFile = {#GcmAssets}\gcmicon64.bmp
60
80
WizardStyle = modern
61
81
WizardImageStretch = no
62
82
WindowResizable = no
63
83
ChangesEnvironment = yes
84
+ #if InstallTarget == " user"
85
+ PrivilegesRequired = lowest
86
+ #endif
64
87
65
88
[Languages]
66
89
Name : english; MessagesFile : " compiler:Default.isl" ;
@@ -72,10 +95,10 @@ Name: full; Description: "Full installation"; Flags: iscustom;
72
95
; No individual components
73
96
74
97
[Run]
75
- Filename : " {app} \git-credential-manager-core.exe " ; Parameters : " configure" ; Flags : runhidden
98
+ Filename : " {app} \{#GcmExe} " ; Parameters : " configure {#GcmConfigureCmdArgs} " ; Flags : runhidden
76
99
77
100
[UninstallRun]
78
- Filename : " {app} \git-credential-manager-core.exe " ; Parameters : " unconfigure" ; Flags : runhidden
101
+ Filename : " {app} \{#GcmExe} " ; Parameters : " unconfigure {#GcmConfigureCmdArgs} " ; Flags : runhidden
79
102
80
103
[Files]
81
104
Source : " {#PayloadDir}\Atlassian.Bitbucket.dll" ; DestDir : " {app} " ; Flags : ignoreversion
@@ -95,3 +118,18 @@ Source: "{#PayloadDir}\Microsoft.IdentityModel.JsonWebTokens.dll"; DestDir:
95
118
Source : " {#PayloadDir}\Microsoft.IdentityModel.Logging.dll" ; DestDir : " {app} " ; Flags : ignoreversion
96
119
Source : " {#PayloadDir}\Microsoft.IdentityModel.Tokens.dll" ; DestDir : " {app} " ; Flags : ignoreversion
97
120
Source : " {#PayloadDir}\Newtonsoft.Json.dll" ; DestDir : " {app} " ; Flags : ignoreversion
121
+
122
+ [Code]
123
+ // Don't allow installing conflicting architectures
124
+ function InitializeSetup (): Boolean;
125
+ begin
126
+ Result := True;
127
+
128
+ #if InstallTarget == " user"
129
+ if not WizardSilent() and IsAdmin() then begin
130
+ if MsgBox(' This User Installer is not meant to be run as an Administrator. If you would like to install Git Credential Manager Core for all users in this system, download the System Installer instead from https://aka.ms/gcmcore-latest. Are you sure you want to continue?' , mbError, MB_OKCANCEL) = IDCANCEL then begin
131
+ Result := False;
132
+ end ;
133
+ end ;
134
+ #endif
135
+ end ;
0 commit comments