Newer
Older
;
[Setup]
AppName=NIF Utilities for 3ds Max
AppVerName=NIF Utilities {code:CurVer} for 3ds Max
OutputBaseFilename=niftools-max-plugins-0.2.12
DisableProgramGroupPage=yes
Compression=lzma
SolidCompression=yes
DirExistsWarning=no
EnableDirDoesntExistWarning=yes
UsePreviousAppDir=yes
DefaultDirName={win}{\}Installer\NifTools
UninstallFilesDir={win}{\}Installer\NifTools
Uninstallable=yes
DisableDirPage=yes
SourceDir=.
;UninstallDisplayIcon={app}{\}..\Oblivion.exe
[Types]
;Name: "full"; Description: "Full installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "gmax12"; Description: "gmax 1.2"; Types: custom;
;Name: "max4"; Description: "3ds Max 4"; Types: custom;
Name: "max42"; Description: "3ds Max 4.2"; Types: custom;
Name: "max5"; Description: "3ds Max 5"; Types: custom;
Name: "max6"; Description: "3ds Max 6"; Types: custom;
Name: "max7"; Description: "3ds Max 7"; Types: custom;
Name: "max8"; Description: "3ds Max 8"; Types: custom;
Name: "max9"; Description: "3ds Max 9 (Win32)"; Types: custom;
Name: "max9x64"; Description: "3ds Max 9 (x64)"; Types: custom;
;Name: "src"; Description: "Program Source";
[Files]
Source: "Staging\Release - gmax\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|gmax12}"; Components: "gmax12"; Flags: isreadme ignoreversion;
Source: "Staging\Release - gmax\nifgmax.exe"; DestDir: "{code:InstallPath|gmax12}"; Components: "gmax12"; Flags: ignoreversion;
;Source: "Staging\Release - gmax\NifPlugins.dlu"; DestDir: "{code:InstallPath|gmax12}{\}plugins"; Components: "gmax12"; Flags: ignoreversion;
Source: "Staging\Release - gmax\MaxNifTools.ini"; DestDir: "{code:InstallPath|gmax12}{\}plugcfg"; Components: "gmax12"; Flags: ignoreversion;
;Source: "Staging\Release - Max 4\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max4}"; Components: "max4"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 4\NifPlugins.dlu"; DestDir: "{code:InstallPath|max4}{\}plugins"; Components: "max4"; Flags: ignoreversion;
;Source: "Staging\Release - Max 4\MaxNifTools.ini"; DestDir: "{code:InstallPath|max4}{\}plugcfg"; Components: "max4"; Flags: ignoreversion;
Source: "Staging\Release - Max 4.2\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max42}"; Components: "max42"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 4.2\NifPlugins.dlu"; DestDir: "{code:InstallPath|max42}{\}plugins"; Components: "max42"; Flags: ignoreversion;
Source: "Staging\Release - Max 4.2\MaxNifTools.ini"; DestDir: "{code:InstallPath|max42}{\}plugcfg"; Components: "max42"; Flags: ignoreversion;
Source: "Staging\Release - Max 5\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max5}"; Components: "max5"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 5\NifPlugins.dlu"; DestDir: "{code:InstallPath|max5}{\}plugins"; Components: "max5"; Flags: ignoreversion;
Source: "Staging\Release - Max 5\MaxNifTools.ini"; DestDir: "{code:InstallPath|max5}{\}plugcfg"; Components: "max5"; Flags: ignoreversion;
Source: "Staging\Release - Max 6\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max6}"; Components: "max6"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 6\NifPlugins.dlu"; DestDir: "{code:InstallPath|max6}{\}plugins"; Components: "max6"; Flags: ignoreversion;
Source: "Staging\Release - Max 6\MaxNifTools.ini"; DestDir: "{code:InstallPath|max6}{\}plugcfg"; Components: "max6"; Flags: ignoreversion;
Source: "Staging\Release - Max 7\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max7}"; Components: "max7"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 7\NifPlugins.dlu"; DestDir: "{code:InstallPath|max7}{\}plugins"; Components: "max7"; Flags: ignoreversion;
Source: "Staging\Release - Max 7\MaxNifTools.ini"; DestDir: "{code:InstallPath|max7}{\}plugcfg"; Components: "max7"; Flags: ignoreversion;
Source: "Staging\Release - Max 8\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max8}"; Components: "max8"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 8\NifPlugins.dlu"; DestDir: "{code:InstallPath|max8}{\}plugins"; Components: "max8"; Flags: ignoreversion;
Source: "Staging\Release - Max 8\MaxNifTools.ini"; DestDir: "{code:InstallPath|max8}{\}plugcfg"; Components: "max8"; Flags: ignoreversion;
Source: "Staging\Release - Max 9\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max9}"; Components: "max9"; Flags: isreadme ignoreversion;
;Source: "Staging\Release - Max 9\NifPlugins.dlu"; DestDir: "{code:InstallPath|max9}{\}plugins"; Components: "max9"; Flags: ignoreversion;
Source: "Staging\Release - Max 9\MaxNifTools.ini"; DestDir: "{code:InstallPath|max9}{\}plugcfg"; Components: "max9"; Flags: ignoreversion;
Source: "Staging\Release - Max 9\MaxNifTools.ini"; DestDir: "{localappdata}{\}Autodesk\3dsmax\9 - 32bit\enu\plugcfg"; Components: "max9"; Flags: ignoreversion;
Source: "Staging\x64\Release - Max 9\MaxNifPlugins_Readme.txt"; DestDir: "{code:InstallPath|max9x64}"; Components: "max9x64"; Flags: isreadme ignoreversion;
;Source: "Staging\x64\Release - Max 9\NifPlugins.dlu"; DestDir: "{code:InstallPath|max9x64}{\}plugins"; Components: "max9x64"; Flags: ignoreversion;
Source: "Staging\x64\Release - Max 9\MaxNifTools.ini"; DestDir: "{code:InstallPath|max9x64}{\}plugcfg"; Components: "max9x64"; Flags: ignoreversion;
Source: "Staging\x64\Release - Max 9\MaxNifTools.ini"; DestDir: "{localappdata}{\}Autodesk\3dsmax\9 - 64bit\enu\plugcfg"; Components: "max9x64"; Flags: ignoreversion;
;Source: "src\*"; DestDir: "{reg:HKLM\SOFTWARE\Bethesda Softworks\Oblivion,Path|{pf}{\}Bethesda Softworks\Oblivion}\Data\niftools"; Components: "src"; Flags: ignoreversion recursesubdirs;
[Code]
var sVersion: String;
i: Integer;
UsagePage: TInputOptionWizardPage;
OBDataDirPage: TInputDirWizardPage;
MWDataDirPage: TInputDirWizardPage;
Civ4DataDirPage: TInputDirWizardPage;
DAoCDataDirPage: TInputDirWizardPage;
FFDataDirPage: TInputDirWizardPage;
FF3RDataDirPage: TInputDirWizardPage;
BCDataDirPage: TInputDirWizardPage;
function InitializeSetup(): Boolean;
begin
Result := True;
end;
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
function GetOptionString(value: Boolean): String;
begin
if value then begin
Result := 'True';
end else begin
Result := 'False';
end;
end;
function GetOptionBool(value: String): Boolean;
begin
if value = 'True' then begin
Result := True;
end else begin
Result := False;
end;
end;
function GetPrevDataBool(key: String; value: Boolean): Boolean;
begin
Result := GetOptionBool(GetPreviousData(key, GetOptionString(value)));
end;
function SetPrevDataString(PreviousDataKey: Integer; key:String; value: Boolean): Boolean;
begin
Result := SetPreviousData(PreviousDataKey, key, GetOptionString(value));
end;
function DataDirPage_ShouldSkipPage(Page: TWizardPage): Boolean;
begin
Result := True;
case Page.ID of
OBDataDirPage.ID: Result := not UsagePage.Values[0];
MWDataDirPage.ID: Result := not UsagePage.Values[1];
Civ4DataDirPage.ID: Result := not UsagePage.Values[2];
DAoCDataDirPage.ID: Result := not UsagePage.Values[3];
FFDataDirPage.ID: Result := not UsagePage.Values[4];
FF3RDataDirPage.ID: Result := not UsagePage.Values[5];
BCDataDirPage.ID: Result := not UsagePage.Values[6];
end;
end;
procedure InitializeWizard;
begin
{ Create the pages }
{ Add each supported game to option page }
UsagePage := CreateInputOptionPage(wpSelectComponents,
'Custom Directories', 'Select Custom Directories for supported Games',
'Please specify which games you wish to add custom directories for, then click Next.',
False, False);
UsagePage.Add('Oblivion');
UsagePage.Add('Morrowind');
UsagePage.Add('Civilization 4');
UsagePage.Add('Dark Age of Camelot');
UsagePage.Add('Freedom Force');
UsagePage.Add('Freedom Force vs. the 3rd Reich');
UsagePage.Add('Star Trek: Bridge Commander');
{ Create pages for each Game texture locations }
OBDataDirPage := CreateInputDirPage(UsagePage.ID,
'Select Oblivion Data Directory', 'Where are the extracted Oblivion data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
OBDataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
OBDataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
OBDataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
MWDataDirPage := CreateInputDirPage(OBDataDirPage.ID,
'Select Morrowind Data Directory', 'Where are the extracted Morrowind data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
MWDataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
MWDataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
MWDataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
Civ4DataDirPage := CreateInputDirPage(MWDataDirPage.ID,
'Select Civilization 4 Data Directory', 'Where are the extracted Civilization 4 data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
Civ4DataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
Civ4DataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
Civ4DataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
DAoCDataDirPage := CreateInputDirPage(Civ4DataDirPage.ID,
'Select Dark Age of Camelot Data Directory', 'Where are the extracted Dark Age of Camelot data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
DAoCDataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
DAoCDataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
DAoCDataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
FFDataDirPage := CreateInputDirPage(DAoCDataDirPage.ID,
'Select Freedom Force Data Directory', 'Where are the extracted Freedom Force data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
FFDataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
FFDataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
FFDataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
FF3RDataDirPage := CreateInputDirPage(FFDataDirPage.ID,
'Select Freedom Force vs. the 3rd Reich Data Directory', 'Where are the extracted Freedom Force vs. the 3rd Reich data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
FF3RDataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
FF3RDataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
FF3RDataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
BCDataDirPage := CreateInputDirPage(DAoCDataDirPage.ID,
'Select Star Trek: Bridge Commander Data Directory', 'Where are the extracted Star Trek: Bridge Commander data files located?',
'Select the folders in which 3ds Max should look for files, then click Next.',
False, '');
BCDataDirPage.OnShouldSkipPage := @DataDirPage_ShouldSkipPage;
BCDataDirPage.Add('Extracted Model Directory (e.g. root directory where NIF files are located)');
BCDataDirPage.Add('Extracted Textures Directory (e.g. root directory containing the Textures directory)');
{ Set default values, using settings that were stored last time if possible }
UsagePage.Values[0] := GetPrevDataBool('bOB', False);
UsagePage.Values[1] := GetPrevDataBool('bMW', False);
UsagePage.Values[2] := GetPrevDataBool('bCiv4', False);
UsagePage.Values[3] := GetPrevDataBool('bDAoC', False);
UsagePage.Values[4] := GetPrevDataBool('bFF', False);
UsagePage.Values[5] := GetPrevDataBool('bFF3R', False);
UsagePage.Values[6] := GetPrevDataBool('bBC', False);
OBDataDirPage.Values[0] := GetPreviousData('OBModelDir', '');
OBDataDirPage.Values[1] := GetPreviousData('OBTexDir', '');
MWDataDirPage.Values[0] := GetPreviousData('MWModelDir', '');
MWDataDirPage.Values[1] := GetPreviousData('MWTexDir', '');
Civ4DataDirPage.Values[0] := GetPreviousData('Civ4ModelDir', '');
Civ4DataDirPage.Values[1] := GetPreviousData('Civ4TexDir', '');
DAoCDataDirPage.Values[0] := GetPreviousData('DAoCModelDir', '');
DAoCDataDirPage.Values[1] := GetPreviousData('DAoCTexDir', '');
FFDataDirPage.Values[0] := GetPreviousData('FFModelDir', '');
FFDataDirPage.Values[1] := GetPreviousData('FFTexDir', '');
FF3RDataDirPage.Values[0] := GetPreviousData('FF3RModelDir', '');
FF3RDataDirPage.Values[1] := GetPreviousData('FF3RTexDir', '');
BCDataDirPage.Values[0] := GetPreviousData('BCModelDir', '');
BCDataDirPage.Values[1] := GetPreviousData('BCTexDir', '');
end;
procedure RegisterPreviousData(PreviousDataKey: Integer);
var
UsageMode: String;
begin
{ Store the settings so we can restore them next time }
SetPrevDataString(PreviousDataKey, 'bOB', UsagePage.Values[0]);
SetPrevDataString(PreviousDataKey, 'bMW', UsagePage.Values[1]);
SetPrevDataString(PreviousDataKey, 'bCiv4', UsagePage.Values[2]);
SetPrevDataString(PreviousDataKey, 'bDAoC', UsagePage.Values[3]);
SetPrevDataString(PreviousDataKey, 'bFF', UsagePage.Values[4]);
SetPrevDataString(PreviousDataKey, 'bFF3R', UsagePage.Values[5]);
SetPrevDataString(PreviousDataKey, 'bBC', UsagePage.Values[6]);
SetPreviousData(PreviousDataKey, 'OBModelDir', OBDataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'OBTexDir', OBDataDirPage.Values[1]);
SetPreviousData(PreviousDataKey, 'MWModelDir', MWDataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'MWTexDir', MWDataDirPage.Values[1]);
SetPreviousData(PreviousDataKey, 'Civ4ModelDir', Civ4DataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'Civ4TexDir', Civ4DataDirPage.Values[1]);
SetPreviousData(PreviousDataKey, 'DAoCModelDir', DAoCDataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'DAoCTexDir', DAoCDataDirPage.Values[1]);
SetPreviousData(PreviousDataKey, 'FFModelDir', FFDataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'FFTexDir', FFDataDirPage.Values[1]);
SetPreviousData(PreviousDataKey, 'FF3RModelDir', FF3RDataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'FF3RTexDir', FF3RDataDirPage.Values[1]);
SetPreviousData(PreviousDataKey, 'BCModelDir', BCDataDirPage.Values[0]);
SetPreviousData(PreviousDataKey, 'BCTexDir', BCDataDirPage.Values[1]);
end;
function InstallPath(Param: String): String;
var
Names: TArrayOfString;
I: Integer;
begin
Result := '';
case Param of
'gmax12':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\gmax', 'uninstallpath', Result) then
Result := ExpandConstant('{sd}{\}gmax12');
'max4':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\3ds max 4', 'uninstallpath', Result) then
Result := ExpandConstant('{sd}{\}3dsmax4');
'max42':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\3ds max 4', 'uninstallpath', Result) then
Result := ExpandConstant('{sd}{\}3dsmax42');
'max5':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\3ds max 5', 'uninstallpath', Result) then
Result := ExpandConstant('{sd}{\}3dsmax5');
'max6':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\6.0', 'InstallDir', Result) then
Result := ExpandConstant('{sd}{\}3dsmax6');
'max7':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\7.0', 'InstallDir', Result) then
Result := ExpandConstant('{sd}{\}3dsmax7');
'max8':
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\8.0', 'InstallDir', Result) then
Result := ExpandConstant('{sd}{\}3dsmax8');
'max9':
begin
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0', Names) then begin
for I := 0 to GetArrayLength(Names)-1 do begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0\' + Names[I], 'Installdir', Result) then begin
break;
end;
end;
end;
if (Length(Result) = 0) then
Result := ExpandConstant('{pf32}{\}AutoDesk\3ds Max 9}{\}plugcfg');
end;
'max9x64':
begin
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0', Names) then begin
for I := 0 to GetArrayLength(Names)-1 do begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0\' + Names[I], 'InstallDir', Result) then
break;
end;
end;
if Length(Result) = 0 then
Result := ExpandConstant('{pf64}{\}AutoDesk\3ds Max 9}{\}plugcfg');
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
end;
else
Result := '';
end;
end;
function RegInstallPath(Param: String): String;
var
Names: TArrayOfString;
I: Integer;
begin
Result := '';
case Param of
'gmax 1.2':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\gmax', 'uninstallpath', Result);
'3ds Max 4':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\3ds max 4', 'uninstallpath', Result);
'3ds Max 4.2':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\3ds max 4', 'uninstallpath', Result);
'3ds Max 5':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\3ds max 5', 'uninstallpath', Result);
'3ds Max 6':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\6.0', 'InstallDir', Result);
'3ds Max 7':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\7.0', 'InstallDir', Result);
'3ds Max 8':
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\8.0', 'InstallDir', Result);
'3ds Max 9 (Win32)':
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0', Names) then begin
for I := 0 to GetArrayLength(Names)-1 do begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0\' + Names[I], 'InstallDir', Result) then
break;
end;
end;
'3ds Max 9 (x64)':
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0', Names) then begin
for I := 0 to GetArrayLength(Names)-1 do begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Autodesk\3dsMax\9.0\' + Names[I], 'InstallDir', Result) then
break;
end;
end;
else
Result := '';
end;
end;
function IsInstalled(Param: String): Boolean;
begin
Result := Length(RegInstallPath(Param)) <> 0;
if Result then begin
if IsWin64() and (Param = '3ds Max 9 (Win32)') then
Result := False;
if not IsWin64() and (Param = '3ds Max 9 (x64)') then
Result := False;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageId = wpSelectComponents then
for i := 0 to WizardForm.ComponentsList.Items.Count - 1 do
WizardForm.ComponentsList.Checked[i] := IsInstalled(WizardForm.ComponentsList.ItemCaption[i]);
end;
function CurVer(Param: String): String;
begin
Result := sVersion;
end;
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
procedure FixPathInINI(component: String);
var
iniFile: String;
begin
if IsComponentSelected(component) then begin
iniFile := InstallPath(component);
iniFile := AddBackslash(iniFile) + '\plugcfg\MaxNifTools.ini';
iniFile := ExpandFileName(iniFile);
if UsagePage.Values[0] then begin {Oblivion}
SetIniString('Oblivion', 'MeshRootPath', OBDataDirPage.Values[0], iniFile);
SetIniString('Oblivion', 'TextureRootPath', OBDataDirPage.Values[1], iniFile);
end else if UsagePage.Values[1] then begin
SetIniString('Morrowind', 'MeshRootPath', MWDataDirPage.Values[0], iniFile);
SetIniString('Morrowind', 'TextureRootPath', MWDataDirPage.Values[1], iniFile);
end else if UsagePage.Values[2] then begin
SetIniString('Civilization 4', 'MeshRootPath', Civ4DataDirPage.Values[0], iniFile);
SetIniString('Civilization 4', 'TextureRootPath', Civ4DataDirPage.Values[1], iniFile);
end else if UsagePage.Values[3] then begin
SetIniString('Dark Age of Camelot', 'MeshRootPath', DAoCDataDirPage.Values[0], iniFile);
SetIniString('Dark Age of Camelot', 'TextureRootPath', DAoCDataDirPage.Values[1], iniFile);
end else if UsagePage.Values[4] then begin
SetIniString('Freedom Force', 'MeshRootPath', FFDataDirPage.Values[0], iniFile);
SetIniString('Freedom Force', 'TextureRootPath', FFDataDirPage.Values[1], iniFile);
end else if UsagePage.Values[5] then begin
SetIniString('Freedom Force vs. the 3rd Reich', 'MeshRootPath', FF3RDataDirPage.Values[0], iniFile);
SetIniString('Freedom Force vs. the 3rd Reich', 'TextureRootPath', FF3RDataDirPage.Values[1], iniFile);
end else if UsagePage.Values[6] then begin
SetIniString('Star Trek: Bridge Commander', 'MeshRootPath', BCDataDirPage.Values[0], iniFile);
SetIniString('Star Trek: Bridge Commander', 'TextureRootPath', BCDataDirPage.Values[1], iniFile);
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssPostInstall) then begin
FixPathInINI('gmax12');
FixPathInINI('max4');
FixPathInINI('max42');
FixPathInINI('max5');
FixPathInINI('max6');
FixPathInINI('max7');
FixPathInINI('max8');
FixPathInINI('max9');
FixPathInINI('max9x64');
end;
end;
[Code]
function RegDisableReflectionKey(B: Integer): Integer;
external 'RegDisableReflectionKey@Advapi32.dll stdcall';