1 ; QGit installation script for Inno Setup compiler
3 ; QGit should be compiled with MSVC 2008, statically linked
4 ; to Qt4.3 or better Trolltech libraries and directory of
5 ; Visual C++ redistributable dll files copied under 'bin\'
10 AppVerName
=QGit version
2.10
11 DefaultDirName
={pf}\QGit
13 UninstallDisplayIcon
={app}\qgit
.exe
16 LicenseFile
=COPYING
.rtf
17 SetupIconFile
=src
\resources\qgit
.ico
19 OutputBaseFilename
=qgit
-2.3_win
22 Source
: "bin\qgit.exe"; DestDir
: "{app}"
23 Source
: "bin\qgit.exe.manifest"; DestDir
: "{app}"
24 Source
: "README_WIN.txt"; DestDir
: "{app}"; Flags
: isreadme
26 ; Directory of MSVC redistributable files must be copied under 'bin\'
27 ; before to run Inno Setup compiler or following line will error out
28 Source
: "bin\Microsoft.VC90.CRT\*"; DestDir
: "{app}\Microsoft.VC90.CRT"
31 Name
: desktopicon; Description
: "Create a &desktop icon";
32 Name
: winexplorer
; Description
: "Add ""QGit Here"" in Windows Explorer context menu";
35 Root
: HKCU
; Subkey
: "Software\qgit"; Flags
: uninsdeletekey
36 Root
: HKCU
; Subkey
: "Software\qgit\qgit4"; ValueType
: string; ValueName
: "msysgit_exec_dir"; ValueData
: "{code:GetMSysGitExecDir}";
38 ; Windows Explorer integration
39 Root
: HKCU
; Subkey
: "SOFTWARE\Classes\Directory\shell\qgit"; Flags
: uninsdeletekey; Tasks
: winexplorer
40 Root
: HKCU
; Subkey
: "SOFTWARE\Classes\Directory\shell\qgit"; ValueType
: string; ValueName
: ""; ValueData
: "&QGit Here"; Tasks
: winexplorer
41 Root
: HKCU
; Subkey
: "SOFTWARE\Classes\Directory\shell\qgit\command"; ValueType
: string; ValueName
: ""; ValueData
: "{app}\qgit.exe"; Tasks
: winexplorer
44 Name
: {code:GetMSysGitExecDir}; Flags
: uninsneveruninstall
47 Name
: "{group}\QGit"; Filename
: "{app}\qgit.exe"; WorkingDir
: "%USERPROFILE%";
48 Name
: "{group}\Uninstall QGit"; Filename
: "{uninstallexe}"
49 Name
: "{commondesktop}\QGit"; Filename
: "{app}\qgit.exe"; WorkingDir
: "%USERPROFILE%"; Tasks
: desktopicon
53 MSysGitDirPage
: TInputDirWizardPage
;
55 procedure InitializeWizard
;
60 // Create msysgit directory find page
61 MSysGitDirPage
:= CreateInputDirPage(wpSelectProgramGroup
,
62 'Select MSYSGIT Location', 'Where is MSYSGIT directory located?',
63 'Select where MSYSGIT directory is located, then click Next.',
66 // Add
item (with an empty caption
)
67 MSysGitDirPage
.Add('');
70 Key
:= 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1';
72 if RegQueryStringValue(HKEY_LOCAL_MACHINE
, Key
, 'InstallLocation', Val
) then begin
73 MSysGitDirPage
.Values
[0] := Val
;
75 MSysGitDirPage
.Values
[0] := ExpandConstant('{pf}\Git');
79 function NextButtonClick(CurPageID
: Integer): Boolean;
84 // Validate pages before allowing the user
to proceed }
85 if CurPageID
= MSysGitDirPage
.ID
then begin
87 BaseDir
:= MSysGitDirPage
.Values
[0];
89 if FileExists(ExpandFileName(BaseDir
+ '\bin\git.exe')) then begin
92 end else if FileExists(ExpandFileName(BaseDir
+ '\..\bin\git.exe')) then begin // sub dir selected
93 MSysGitDirPage
.Values
[0] := ExpandFileName(BaseDir
+ '\..');
97 MsgBox('Directory ''' + BaseDir
+ ''' does not seem the msysgit one, retry', mbError
, MB_OK
);
105 function GetMSysGitExecDir(Param
: String): String;
107 Result
:= MSysGitDirPage
.Values
[0] + '\bin'; // already validated