2 #define APP_VERSION
'%APPVERSION%'
3 #define APP_URL
'http://code.google.com/p/msysgit/'
4 #define APP_BUILTINS
'etc\fileList-builtins.txt'
8 InternalCompressLevel
=max
9 OutputBaseFilename
={#emit APP_NAME+'-'+APP_VERSION}
15 AppName
={#emit APP_NAME}
16 AppPublisherURL
={#emit APP_URL}
17 AppVersion
={#emit APP_VERSION}
18 AppVerName
={#emit APP_NAME+' '+APP_VERSION}
19 ChangesEnvironment
=yes
20 DefaultDirName
={pf}\
{#emit APP_NAME}
21 DefaultGroupName
={#emit APP_NAME}
23 LicenseFile
=gpl
-2.0.txt
24 UninstallDisplayIcon
=etc\git
.ico
27 SetupIconFile
=etc\git
.ico
28 WizardSmallImageFile
=git
.bmp
31 Name
: modifypath
; Description
: "Modify &PATH environment variable"; Flags
: checkedonce
32 Name
: modifypath\git
; Description
: "Add &only Git"; Flags
: exclusive
33 Name
: modifypath
\tools
; Description
: "Add Git and UNIX &tools"; Flags
: exclusive unchecked
35 Name
: shellextension
; Description
: "Add ""Git &Bash Here"" to Windows Explorer"; Flags
: checkedonce
36 Name
: guiextension
; Description
: "Add ""Git &GUI Here"" to Windows Explorer"; Flags
: checkedonce
38 Name
: quicklaunchicon; Description
: "Create a &Quick Launch icon"; GroupDescription
: "Additional icons:"; Flags
: checkedonce
39 Name
: desktopicon; Description
: "Create a &Desktop icon"; GroupDescription
: "Additional icons:"; Flags
: checkedonce
42 Source
: "*"; DestDir
: "{app}"; Excludes
: "\*.txt, \install.*, \tmp.*, \bin\*install*"; Flags
: recursesubdirs
45 Name
: "{group}\Git GUI"; Filename
: "{app}\bin\wish.exe"; Parameters
: """{app}\bin\git-gui"""; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"
46 Name
: "{group}\Git Bash"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"
47 Name
: "{group}\Uninstall Git"; Filename
: "{uninstallexe}"
48 Name
: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Git Bash"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"; Tasks
: quicklaunchicon
49 Name
: "{userdesktop}\Git Bash"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"; Tasks
: desktopicon
52 BeveledLabel
={#emit APP_URL}
55 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_shell"; ValueType
: string; ValueData
: "Git &Shell Here"; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: shellextension
56 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_shell\command"; ValueType
: string; ValueData
: "cmd.exe /c ""pushd ""%1"" && ""{app}\bin\sh.exe"" --login -i"""; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: shellextension
57 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_gui"; ValueType
: string; ValueData
: "Git &GUI Here"; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: guiextension
58 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_gui\command"; ValueType
: string; ValueData
: """{app}\bin\wish.exe"" ""{app}\bin\git-gui"" ""--working-dir"" ""%1"""; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: guiextension
61 Type: files; Name
: "{app}\bin\git-*.exe"
62 Type: dirifempty; Name
: "{app}\home\{username}"
63 Type: dirifempty; Name
: "{app}\home"
66 function ModPathDir
:TArrayOfString
;
68 IsModifyPathGit
,IsModifyPathTools
:Boolean;
71 if IsUninstaller
then begin
72 if LoadStringFromFile(ExpandConstant('{app}')+'\uninsTasks.txt',SelectedTasks
) then begin
73 IsModifyPathGit
:=Pos('modifypath\git',SelectedTasks
)>0;
74 IsModifyPathTools
:=Pos('modifypath\tools',SelectedTasks
)>0;
76 IsModifyPathGit
:=False;
77 IsModifyPathTools
:=False;
80 IsModifyPathGit
:=IsTaskSelected('modifypath\git');
81 IsModifyPathTools
:=IsTaskSelected('modifypath\tools');
84 if IsModifyPathGit
then begin
85 setArrayLength(Result
,1);
86 Result
[0]:=ExpandConstant('{app}\cmd');
87 end else if IsModifyPathTools
then begin
88 setArrayLength(Result
,2);
89 Result
[0]:=ExpandConstant('{app}\bin');
90 Result
[1]:=ExpandConstant('{app}\mingw\bin');
93 #include
"modpath.iss"
95 procedure InitializeWizard
;
97 // Use a mono spaced font
in the license dialog
. NOTE
: This might be too small
.
98 WizardForm
.LicenseMemo
.Font
.Name
:='Lucida Console';
99 WizardForm
.LicenseMemo
.Font
.Size
:=7;
102 function CreateHardLink(lpFileName
,lpExistingFileName
:string;lpSecurityAttributes
:Integer):Boolean;
103 external 'CreateHardLinkA@Kernel32.dll';
105 procedure CurStepChanged(CurStep
:TSetupStep
);
107 LinkOrCopy
:TOutputProgressWizardPage
;
108 FileName
,AppDir
:string;
109 BuiltIns
:TArrayOfString
;
113 if CurStep
=ssDone
then begin
114 if IsTaskSelected('modifypath') then begin
117 end else if CurStep
=ssPostInstall
then begin
118 LinkOrCopy
:=CreateOutputProgressPage('Creating Build-Ins','Please wait while Setup creates built-in command files.');
121 // Load the built
-ins from a
text file.
122 FileName
:=ExpandConstant('{app}\'+'{#emit APP_BUILTINS}');
123 if not LoadStringsFromFile(FileName,BuiltIns) then begin
124 MsgBox('Unable
to read file "{#emit APP_BUILTINS}".', mbError, MB_OK);
128 AppDir:=ExpandConstant('{app}');
130 // Check if we are running on NTFS.
132 if SetNTFSCompression(AppDir+'\bin\git
.exe
',true) then begin
133 IsNTFS:=SetNTFSCompression(AppDir+'\bin\git
.exe
',false);
136 Count:=GetArrayLength(BuiltIns)-1;
138 // Map the built-ins to git.exe.
140 for i:=0 to Count do begin
141 FileName:=AppDir+'\'+BuiltIns
[i
];
143 // On non
-NTFS partitions
, create hard links
.
144 LinkOrCopy
.SetText('Creating hard link...',FileName
);
145 LinkOrCopy
.SetProgress(i
,Count
);
146 CreateHardLink(FileName
,AppDir
+'\bin\git.exe',0);
149 for i
:=0 to GetArrayLength(BuiltIns
)-1 do begin
150 FileName
:=AppDir
+'\'+BuiltIns[i];
152 // On non-NTFS partitions, copy simply the files.
153 LinkOrCopy.SetText('Copying
file...',FileName);
154 LinkOrCopy.SetProgress(i,Count);
155 FileCopy(AppDir+'\bin\git
.exe
',FileName,false);