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
=install
.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 ListFile
,AppDir
:string;
108 BuiltIns
:TArrayOfString
;
112 if CurStep
=ssPostInstall
then begin
113 if IsTaskSelected('modifypath') then begin
116 end else if CurStep
=ssDone
then begin
117 // Load the built
-ins from a
text file.
118 ListFile
:=ExpandConstant('{app}\'+'{#emit APP_BUILTINS}');
119 if not LoadStringsFromFile(ListFile,BuiltIns) then begin
120 MsgBox('Unable
to read file "{#emit APP_BUILTINS}".', mbError, MB_OK);
124 AppDir:=ExpandConstant('{app}');
126 // Check if we are running on NTFS.
128 if SetNTFSCompression(AppDir+'\bin\git
.exe
',true) then begin
129 IsNTFS:=SetNTFSCompression(AppDir+'\bin\git
.exe
',false);
132 // Map the built-ins to git.exe.
134 for i:=0 to GetArrayLength(BuiltIns)-1 do begin
135 // On non-NTFS partitions, create hard links.
136 CreateHardLink(AppDir+'\'+BuiltIns
[i
],AppDir
+'\bin\git.exe',0);
139 for i
:=0 to GetArrayLength(BuiltIns
)-1 do begin
140 // On non
-NTFS partitions
, copy simply the
files.
141 FileCopy(AppDir
+'\bin\git.exe',AppDir
+'\'+BuiltIns[i],false);