Use a nicer GPL license text in rtf format
[qgit4.git] / qgit_inno_setup.iss
blob6883d2c2f5943048f9dc5f4e52482af14cb7b455
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\'
6 ; directory
8 [Setup]
9 AppName=QGit
10 AppVerName=QGit version 2.1
11 DefaultDirName={pf}\QGit
12 DefaultGroupName=QGit
13 UninstallDisplayIcon={app}\qgit.exe
14 Compression=lzma
15 SolidCompression=yes
16 LicenseFile=COPYING.rtf
17 SetupIconFile=src\resources\qgit.ico
18 SourceDir=C:\Users\Marco\Documenti\qgit
19 OutputDir=bin
20 OutputBaseFilename=qgit2.1_win
22 [Files]
23 Source: "bin\qgit.exe"; DestDir: "{app}"
24 Source: "bin\qgit.exe.manifest"; DestDir: "{app}"
25 Source: "README_WIN.txt"; DestDir: "{app}"; Flags: isreadme
27 ; Directory of MSVC redistributable files must be copied under 'bin\'
28 ; before to run Inno Setup compiler or following line will error out
29 Source: "bin\Microsoft.VC90.CRT\*"; DestDir: "{app}\Microsoft.VC90.CRT"
31 [Registry]
32 Root: HKCU; Subkey: "Software\qgit"; Flags: uninsdeletekey
33 Root: HKCU; Subkey: "Software\qgit\qgit4"; ValueType: string; ValueName: "msysgit_exec_dir"; ValueData: "{code:GetMSysGitExecDir}";
35 [Dirs]
36 Name: {code:GetMSysGitExecDir}; Flags: uninsneveruninstall
38 [Tasks]
39 Name: desktopicon; Description: "Create a &desktop icon";
41 [Icons]
42 Name: "{group}\QGit"; Filename: "{app}\qgit.exe"; WorkingDir: "{app}"
43 Name: "{group}\Uninstall QGit"; Filename: "{uninstallexe}"
44 Name: "{commondesktop}\QGit"; Filename: "{app}\qgit.exe"; WorkingDir: "{app}"; Tasks: desktopicon
46 [Code]
47 var
48 MSysGitDirPage: TInputDirWizardPage;
50 procedure InitializeWizard;
51 begin
52 // Create msysgit directory find page
53 MSysGitDirPage := CreateInputDirPage(wpSelectProgramGroup,
54 'Select MSYSGIT Location', 'Where is MSYSGIT directory located?',
55 'Select where MSYSGIT directory is located, then click Next.',
56 False, '');
58 // Add item (with an empty caption)
59 MSysGitDirPage.Add('');
61 // Set initial value
62 MSysGitDirPage.Values[0] := ExpandConstant('{pf}\Git');
63 end;
65 function NextButtonClick(CurPageID: Integer): Boolean;
66 var
67 BaseDir: String;
68 begin
69 // Validate pages before allowing the user to proceed }
70 if CurPageID = MSysGitDirPage.ID then begin
72 BaseDir := MSysGitDirPage.Values[0];
74 if FileExists(ExpandFileName(BaseDir + '\bin\git.exe')) then begin
75 Result := True;
77 end else if FileExists(ExpandFileName(BaseDir + '\..\bin\git.exe')) then begin // sub dir selected
78 MSysGitDirPage.Values[0] := ExpandFileName(BaseDir + '\..');
79 Result := True;
81 end else begin
82 MsgBox('Directory ''' + BaseDir + ''' does not seem the msysgit one, retry', mbError, MB_OK);
83 Result := False;
84 end;
86 end else
87 Result := True;
88 end;
90 function GetMSysGitExecDir(Param: String): String;
91 begin
92 Result := MSysGitDirPage.Values[0] + '\bin'; // already validated
93 end;