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 DefaultDirName
={pf}\
{#emit APP_NAME}
20 DefaultGroupName
={#emit APP_NAME}
22 LicenseFile
=gpl
-2.0.txt
25 SetupIconFile
=etc\git
.ico
26 WizardSmallImageFile
=install
.bmp
29 Name
: quicklaunchicon; Description
: "Create a &Quick Launch icon"; GroupDescription
: "Additional icons:"; Flags
: checkedonce
30 Name
: desktopicon; Description
: "Create a &Desktop icon"; GroupDescription
: "Additional icons:"; Flags
: checkedonce
31 Name
: shellextension
; Description
: "Add ""Git Shell Here"" "; GroupDescription
: "Shell extensions:"; Flags
: checkedonce
32 Name
: guiextension
; Description
: "Add ""Git GUI Here"" "; GroupDescription
: "Shell extensions:"; Flags
: checkedonce
35 Source
: "*"; DestDir
: "{app}"; Excludes
: "\*.txt, \install.*, \tmp.*, \bin\*install*"; Flags
: recursesubdirs
38 Name
: "{group}\Git GUI"; Filename
: "{app}\bin\wish.exe"; Parameters
: """{app}\bin\git-gui"""; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"
39 Name
: "{group}\Git Shell"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"
40 Name
: "{group}\Uninstall Git"; Filename
: "{uninstallexe}"
41 Name
: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Git Shell"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"; Tasks
: quicklaunchicon
42 Name
: "{userdesktop}\Git Shell"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%USERPROFILE%"; IconFilename
: "{app}\etc\git.ico"; Tasks
: desktopicon
45 BeveledLabel
={#emit APP_URL}
48 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_shell"; ValueType
: string; ValueData
: "Git &Shell Here"; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: shellextension
49 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
50 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_gui"; ValueType
: string; ValueData
: "Git &GUI Here"; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: guiextension
51 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
54 Type: files; Name
: "{app}\bin\git-*.exe"
55 Type: dirifempty; Name
: "{app}\home\{username}"
56 Type: dirifempty; Name
: "{app}\home"
59 procedure InitializeWizard
;
61 // Use a mono spaced font
in the license dialog
. NOTE
: This might be too small
.
62 WizardForm
.LicenseMemo
.Font
.Name
:='Lucida Console';
63 WizardForm
.LicenseMemo
.Font
.Size
:=7;
66 function CreateHardLink(lpFileName
,lpExistingFileName
:string;lpSecurityAttributes
:Integer):Boolean;
67 external 'CreateHardLinkA@Kernel32.dll';
69 procedure CurStepChanged(CurStep
:TSetupStep
);
71 ListFile
,AppDir
:string;
72 BuiltIns
:TArrayOfString
;
76 if CurStep
<>ssDone
then begin
80 // Load the built
-ins from a
text file.
81 ListFile
:=ExpandConstant('{app}\'+'{#emit APP_BUILTINS}');
82 if not LoadStringsFromFile(ListFile,BuiltIns) then begin
83 MsgBox('Unable
to read file "{#emit APP_BUILTINS}".', mbError, MB_OK);
87 AppDir:=ExpandConstant('{app}');
89 // Check if we are running on NTFS.
91 if SetNTFSCompression(AppDir+'\bin\git
.exe
',true) then begin
92 IsNTFS:=SetNTFSCompression(AppDir+'\bin\git
.exe
',false);
95 // Map the built-ins to git.exe.
97 for i:=0 to GetArrayLength(BuiltIns)-1 do begin
98 // On non-NTFS partitions, create hard links.
99 CreateHardLink(AppDir+'\'+BuiltIns
[i
],AppDir
+'\bin\git.exe',0);
102 for i
:=0 to GetArrayLength(BuiltIns
)-1 do begin
103 // On non
-NTFS partitions
, copy simply the
files.
104 FileCopy(AppDir
+'\bin\git.exe',AppDir
+'\'+BuiltIns[i],false);