Skip to content

Commit 07922a5

Browse files
committed
Merge pull request #43 from dtarb/42-add-GDAL-Python-module-to-installer
Setup script updated to install GDAL python module
2 parents 30051de + 0bd6c92 commit 07922a5

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

WindowsInstaller/setup.iss

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
; **** REQUIREMENTS FOR COMPILING THIS INSTALLER SCRIPT ****
66
; The following files must exist in the same directory location as this script
7-
; gdal-111-1600-core.msi
8-
; gdal-111-1600-x64-core.msi
7+
; GDAL-1.9.2.win32-py2.7.exe (Python GDAL)
8+
; gdal-111-1600-core.msi (C++ GDAL
9+
; gdal-111-1600-x64-core.msi (C++ GDAL
910
; mpi_x86.msi
1011
; mpi_x64.msi
1112
; vcredist_x86_2010.exe
@@ -65,6 +66,7 @@ Name: "C:\GDAL"
6566

6667
[Files]
6768
; copy files
69+
Source: "GDAL-1.9.2.win32-py2.7.exe"; DestDir: "{app}\setup_files"; Flags: ignoreversion
6870
Source: "gdal-111-1600-core.msi"; DestDir: "{app}\setup_files"; Flags: ignoreversion; Check: not Is64BitInstallMode
6971
Source: "gdal-111-1600-x64-core.msi"; DestDir: "{app}\setup_files"; Flags: ignoreversion; Check: Is64BitInstallMode
7072

@@ -88,6 +90,7 @@ Source: "Firewall.bat"; DestDir: "{app}\setup_files"; Flags: ignoreversion
8890

8991
[Run]
9092
; install GDAL core components
93+
Filename: "{app}\setup_files\GDAL-1.9.2.win32-py2.7.exe"; Flags: waituntilterminated shellexec
9194
Filename: "{app}\setup_files\gdal-111-1600-core.msi"; Flags: waituntilterminated shellexec; Check: not Is64BitInstallMode
9295
Filename: "{app}\setup_files\gdal-111-1600-x64-core.msi"; Flags: waituntilterminated shellexec; Check: Is64BitInstallMode
9396

@@ -106,6 +109,10 @@ Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environmen
106109
;set GDAL program path
107110
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{pf}\GDAL"; Check: NeedsAddPath('{pf}\GDAL', True, True); Flags: preservestringtype
108111
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{pf}\GDAL"; Check: NeedsAddPath('{pf}\GDAL', False, True); Flags: preservestringtype
112+
113+
;set GDAL_DATA (new environment variable)
114+
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"GDAL_DATA"; ValueData:"{pf}\GDAL\gdal-data"; Flags: preservestringtype
115+
109116
; set TauDEM path
110117
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\TauDEM5Exe"; Check: NeedsAddPath('{app}\TauDEM5Exe', False, True); Flags: preservestringtype
111118
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\TauDEM5Exe"; Check: NeedsAddPath('{app}\TauDEM5Exe', True, True); Flags: preservestringtype
@@ -129,14 +136,14 @@ begin
129136
begin
130137
UserPage := CreateInputQueryPage(wpWelcome,
131138
'The following programs will be installed', '',
132-
'TauDEM version 5.3, GDAL 111 (MSVC 2010) for 64 bit Winodws PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
139+
'TauDEM version 5.3.2, GDAL 1.9.2 (Python 2.7), GDAL 111 (MSVC 2010) for 64 bit Winodws PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
133140
'Microsoft Visual C++ 2010 SP1 Redistributable Package (x64), Microsoft HPC Pack 2012 MS-MPI Redistributable Package'#13#13 + notes_string);
134141
end
135142
else
136143
begin
137144
UserPage := CreateInputQueryPage(wpWelcome,
138145
'The following programs will be installed', '',
139-
'TauDEM version 5.3, GDAL 111 (MSVC 2010) for 32 bit Windows PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
146+
'TauDEM version 5.3.2, GDAL 1.9.2 (Python 2.7), GDAL 111 (MSVC 2010) for 32 bit Windows PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
140147
'Microsoft HPC Pack 2012 MS-MPI Redistributable Package'#13#13 + notes_string);
141148
end
142149
end;
@@ -257,6 +264,25 @@ begin
257264
// MsgBox('Result of path matching:match found', mbInformation, MB_OK)
258265
end;
259266
267+
function GetPathData(Param: String): String;
268+
{ The 'Param' parameter has the value of the existing value for the system 'Path' variable }
269+
var
270+
index: integer;
271+
dataToAdd: string;
272+
begin
273+
{ This is the data we want to add to the system 'Path' variable}
274+
dataToAdd:= ExpandConstant('{app}') + '\GDAL\gdalwin32-1.6\bin;' + ExpandConstant('{app}') + '\GDAL_Proj\proj\bin';
275+
276+
{ check if the data we want to add is already in the 'Path' variable }
277+
index:=pos(dataToAdd, Param)
278+
if index > 0 then
279+
{ no need to change data for the path - so return the existing data}
280+
Result:= Param
281+
else
282+
{ append new data to existing path data and return the resultant data }
283+
Result:= Param + ';' + dataToAdd;
284+
end;
285+
260286
procedure CleanUp(FolderToDelete: string);
261287
begin
262288
if DirExists(ExpandConstant(FolderToDelete)) then

0 commit comments

Comments
 (0)