2 #define APP_VERSION
'%APPVERSION%'
3 #define APP_URL
'http://code.google.com/p/msysgit/'
4 #define APP_BUILTINS
'etc\fileList-builtins.txt'
8 OutputBaseFilename
={#emit APP_NAME+'-'+APP_VERSION}
14 AppName
={#emit APP_NAME}
15 AppPublisherURL
={#emit APP_URL}
16 AppVersion
={#emit APP_VERSION}
17 AppVerName
={#emit APP_NAME+' '+APP_VERSION}
18 DefaultDirName
={pf}\
{#emit APP_NAME}
19 DefaultGroupName
={#emit APP_NAME}
21 LicenseFile
=gpl
-2.0.txt
24 SetupIconFile
=etc\git
.ico
25 WizardSmallImageFile
=install
.bmp
28 Name
: quicklaunchicon; Description
: "Create a &Quick Launch icon"; GroupDescription
: "Additional icons:"; Flags
: checkedonce
29 Name
: desktopicon; Description
: "Create a &Desktop icon"; GroupDescription
: "Additional icons:"; Flags
: checkedonce
30 Name
: shellextension
; Description
: "Add ""Git Shell Here"" "; GroupDescription
: "Shell extensions:"; Flags
: checkedonce
31 Name
: guiextension
; Description
: "Add ""Git GUI Here"" "; GroupDescription
: "Shell extensions:"; Flags
: checkedonce
34 Source
: "*"; DestDir
: "{app}"; Excludes
: "\*.txt, \install.*, \tmp.*, \bin\*install*"; Flags
: recursesubdirs
37 Name
: "{group}\Git GUI"; Filename
: "{app}\bin\wish.exe"; Parameters
: "{app}\bin\git-gui"; WorkingDir
: "%APPDATA%\Git"; IconFilename
: "{app}\etc\git.ico"
38 Name
: "{group}\Git Shell"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%APPDATA%\Git"; IconFilename
: "{app}\etc\git.ico"
39 Name
: "{group}\Uninstall Git"; Filename
: "{uninstallexe}"
40 Name
: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Git Shell"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%APPDATA%\Git"; IconFilename
: "{app}\etc\git.ico"; Tasks
: quicklaunchicon
41 Name
: "{userdesktop}\Git Shell"; Filename
: "{app}\bin\sh.exe"; Parameters
: "--login -i"; WorkingDir
: "%APPDATA%\Git"; IconFilename
: "{app}\etc\git.ico"; Tasks
: desktopicon
44 BeveledLabel
={#emit APP_URL}
47 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_shell"; ValueType
: string; ValueData
: "Git &Shell Here"; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: shellextension
48 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
49 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_gui"; ValueType
: string; ValueData
: "Git &GUI Here"; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: guiextension
50 Root
: HKLM
; Subkey
: "SOFTWARE\Classes\Directory\shell\git_gui\command"; ValueType
: string; ValueData
: """{app}\bin\wish.exe"" ""{app}\bin\git-gui"""; Flags
: uninsdeletevalue uninsdeletekeyifempty; Tasks
: guiextension
53 Type: files; Name
: "{app}\bin\git-*.exe"
54 Type: dirifempty; Name
: "{app}\home\{username}"
55 Type: dirifempty; Name
: "{app}\home"
58 procedure InitializeWizard
;
60 // Use a mono spaced font
in the license dialog
. NOTE
: This might be too small
.
61 WizardForm
.LicenseMemo
.Font
.Name
:='Lucida Console';
62 WizardForm
.LicenseMemo
.Font
.Size
:=7;
65 function CreateHardLink(lpFileName
,lpExistingFileName
:string;lpSecurityAttributes
:Integer):Boolean;
66 external 'CreateHardLinkA@Kernel32.dll';
68 procedure CurStepChanged(CurStep
:TSetupStep
);
70 ListFile
,AppDir
:string;
71 BuiltIns
:TArrayOfString
;
75 if CurStep
<>ssDone
then begin
79 // Load the built
-ins from a
text file.
80 ListFile
:=ExpandConstant('{app}\'+'{#emit APP_BUILTINS}');
81 if not LoadStringsFromFile(ListFile,BuiltIns) then begin
82 MsgBox('Unable
to read file "{#emit APP_BUILTINS}".', mbError, MB_OK);
86 AppDir:=ExpandConstant('{app}');
88 // Check if we are running on NTFS.
90 if SetNTFSCompression(AppDir+'\bin\git
.exe
',true) then begin
91 IsNTFS:=SetNTFSCompression(AppDir+'\bin\git
.exe
',false);
94 // Map the built-ins to git.exe.
96 for i:=0 to GetArrayLength(BuiltIns)-1 do begin
97 // On non-NTFS partitions, create hard links.
98 CreateHardLink(AppDir+'\'+BuiltIns
[i
],AppDir
+'\bin\git.exe',0);
101 for i
:=0 to GetArrayLength(BuiltIns
)-1 do begin
102 // On non
-NTFS partitions
, copy simply the
files.
103 FileCopy(AppDir
+'\bin\git.exe',AppDir
+'\'+BuiltIns[i],false);