]> icculus.org git repositories - divverent/netradiant.git/blob - setup/win32/template/Script Files/Setup.rul
git-svn-id: svn://svn.icculus.org/netradiant/trunk@55 61c419a2-8eb2-4b30-bcec-8cead03...
[divverent/netradiant.git] / setup / win32 / template / Script Files / Setup.rul
1
2 ////////////////////////////////////////////////////////////////////////////////
3 //
4 //  IIIIIII SSSSSS
5 //    II    SS                          InstallShield (R)
6 //    II    SSSSSS      (c) 1996-2000, InstallShield Software Corporation
7 //    II        SS      (c) 1990-1996, InstallShield Corporation
8 //  IIIIIII SSSSSS                     All Rights Reserved.
9 //
10 //
11 //  This code is generated as a starting setup template.  You should
12 //  modify it to provide all necessary steps for your setup.
13 //
14 //
15 //    File Name:  Setup.rul
16 //
17 //  Description:  InstallShield script
18 //
19 //     Comments:  This template script performs a basic setup. With minor
20 //                modifications, this template can be adapted to create
21 //                new, customized setups.
22 //
23 ////////////////////////////////////////////////////////////////////////////////
24
25
26 // Include header files
27
28 #include "ifx.h" //DO NOT REMOVE
29
30 ////////////////////// string defines ////////////////////////////
31
32 //////////////////// installation declarations ///////////////////
33
34 // ---- globals ----
35 // we don't need full/non-full information
36 // only the following are used for UI
37
38 NUMBER DO_CORE_BOOL;
39 NUMBER DO_NIGHTLY_BOOL;
40
41 // Q3
42 NUMBER DO_GAME_Q3_BOOL;
43 // per-game package global config
44 STRING  szDIR_GAME_Q3, szDIR_GAMETOOLS_Q3;
45
46 // Wolf
47 NUMBER DO_GAME_WOLF_BOOL;
48 STRING szDIR_GAME_WOLF, szDIR_GAMETOOLS_WOLF;
49
50 // JKII
51 NUMBER DO_GAME_JKII_BOOL;
52 STRING szDIR_GAME_JKII, szDIR_GAMETOOLS_JKII;
53
54 // STVEF
55 NUMBER DO_GAME_STVEF_BOOL;
56 STRING szDIR_GAME_STVEF, szDIR_GAMETOOLS_STVEF;
57
58 // SOF2
59 NUMBER DO_GAME_SOF2_BOOL;
60 STRING szDIR_GAME_SOF2, szDIR_GAMETOOLS_SOF2;
61
62 // Halflife
63 NUMBER DO_GAME_HALFLIFE_BOOL;
64 NUMBER DO_GAME_CSTRIKE_BOOL; // only used for .game generation
65 STRING szDIR_GAME_HALFLIFE, szDIR_GAMETOOLS_HALFLIFE;
66
67 // ET
68 NUMBER DO_GAME_ET_BOOL;
69 STRING szDIR_GAME_ET, szDIR_GAMETOOLS_ET;
70
71 // Quake
72 NUMBER DO_GAME_Q1_BOOL;
73 STRING szDIR_GAME_Q1, szDIR_GAMETOOLS_Q1;
74
75 // JA
76 NUMBER DO_GAME_JA_BOOL;
77 STRING szDIR_GAME_JA, szDIR_GAMETOOLS_JA;
78
79 // Q2
80 NUMBER DO_GAME_Q2_BOOL;
81 STRING szDIR_GAME_Q2, szDIR_GAMETOOLS_Q2;
82
83 // HER2
84 NUMBER DO_GAME_HER2_BOOL;
85 STRING szDIR_GAME_HER2, szDIR_GAMETOOLS_HER2;
86
87 // ---- script function prototypes -----
88
89
90 // your script function prototypes
91 prototype ReadInfoList(LIST);
92
93 function ReadInfoList(svInfoList)
94         STRING svLine;
95         NUMBER nFlag, nvFileHandle;
96
97 begin
98         OpenFileMode(FILE_MODE_NORMAL);
99         OpenFile(nvFileHandle, SUPPORTDIR, "infolist.txt");
100         while (nFlag = 0)
101                 nFlag = GetLine(nvFileHandle, svLine);
102                 ListAddString(svInfoList, svLine, AFTER);
103         endwhile;
104         CloseFile(nvFileHandle);
105 end;
106
107
108
109 //////////////////////////////////////////////////////////////////////////////
110 //
111 //  FUNCTION:   OnFirstUIBefore
112 //
113 //  EVENT:      FirstUIBefore event is sent when installation is run for the first
114 //              time on given machine. In the handler installation usually displays
115 //              UI allowing end user to specify installation parameters. After this
116 //              function returns, ComponentTransferData is called to perform file
117 //              transfer.
118 //
119 ///////////////////////////////////////////////////////////////////////////////
120 function OnFirstUIBefore()
121     NUMBER  nRegKey,nRegKeySize,nKeyType;
122     STRING  szRegKey, szQuake3, szJKII, szSTVEF, szSOF2, szRTCW, szHL, szCStrike, szET, szQ1, szJA, szQ2, szHER2;
123     NUMBER  nResult,nSetupType;
124     STRING  szTitle, szMsg;
125     STRING  szLicenseFile, szQuestion;
126     STRING  szTargetPath;
127     STRING  szDir, szSubDir;
128     STRING  szfolder;
129     STRING  szComponents, szTargetdir;
130     STRING  svSetupType;
131     NUMBER  nLevel;
132     LIST    listStartCopy, listInfoList;
133     NUMBER  nvSize;
134     STRING  DEFAULTJKIIDIR;
135     STRING  DEFAULTSTVEFDIR;
136     STRING  DEFAULTSOF2DIR;
137     STRING  DEFAULTRTCWDIR;
138     STRING  DEFAULTHALFLIFEDIR;
139     STRING  DEFAULTETDIR;
140     STRING  DEFAULTQ1DIR;
141     STRING  DEFAULTJADIR;
142 begin
143
144 // config
145 // some defaults
146 szSubDir = "Radiant-1.<<RADIANT_MAJOR>>";
147
148 // template
149 DO_CORE_BOOL = <<DO_CORE_BOOL>>;
150 DO_NIGHTLY_BOOL = <<DO_NIGHTLY_BOOL>>;
151 DO_GAME_Q3_BOOL = <<DO_GAME_Q3_BOOL>>;
152 DO_GAME_WOLF_BOOL = <<DO_GAME_WOLF_BOOL>>;
153 DO_GAME_JKII_BOOL = <<DO_GAME_JKII_BOOL>>;
154 DO_GAME_STVEF_BOOL = <<DO_GAME_STVEF_BOOL>>;
155 DO_GAME_SOF2_BOOL = <<DO_GAME_SOF2_BOOL>>;
156 DO_GAME_HALFLIFE_BOOL = <<DO_GAME_HALFLIFE_BOOL>>;
157 DO_GAME_ET_BOOL = <<DO_GAME_ET_BOOL>>;
158 DO_GAME_Q1_BOOL = <<DO_GAME_Q1_BOOL>>;
159 DO_GAME_JA_BOOL = <<DO_GAME_JA_BOOL>>;
160 DO_GAME_Q2_BOOL = <<DO_GAME_Q2_BOOL>>;
161 DO_GAME_HER2_BOOL = <<DO_GAME_HER2_BOOL>>;
162 // common stuff
163
164   // TO DO: if you want to enable background, window title, and caption bar title
165   // SetTitle( @TITLE_MAIN, 24, WHITE );
166   // SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION );
167   // Enable( FULLWINDOWMODE );
168   // Enable( BACKGROUND );
169   // SetColor(BACKGROUND,RGB (0, 128, 128);
170
171 Dlg_Start:
172   // beginning of dialogs label
173
174 Dlg_SdWelcome:
175   szTitle = "";
176   szMsg   = "";
177   nResult = SdWelcome( szTitle, szMsg );
178   if (nResult = BACK) goto Dlg_Start;
179
180 Dlg_SdLicense:
181   szLicenseFile = SUPPORTDIR ^ "license.txt";
182   szTitle    = "";
183   szMsg      = "";
184   szQuestion = "";
185   nResult    = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
186   if (nResult = BACK) goto Dlg_SdWelcome;
187
188 Dlg_SdShowInfoList:
189   szTitle               = "Information\nLatest " + @PRODUCT_NAME + " project information.";
190   szMsg         = "";
191   listInfoList = ListCreate( STRINGLIST );
192   ReadInfoList(listInfoList);
193   // sdShowInfoList dialog customised in _IsUser.dll
194   nResult     = SdShowInfoList( szTitle, szMsg, listInfoList );
195   if (nResult = BACK) goto Dlg_SdLicense;
196
197   // TODO TTimo: prompt for what is in the setup and what the user wants to install?
198   // i.e. by component
199
200   // core
201   if (DO_CORE_BOOL == 1) then
202 Dlg_SdAskCorePath:
203     szDir   = "C:\\Program Files\\GtkRadiant-1.<<RADIANT_MAJOR>>";
204     szTitle = "Installation of " + @PRODUCT_NAME + " core files.";
205     szMsg   = "Select the installation path for " + @PRODUCT_NAME + " core files.";
206     nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
207     // FIXME TTimo if a setup doesn't hold the core, it prolly needs to default that
208     // reading from registry for instance (if TARGETDIR init is required)
209     TARGETDIR = szDir;
210     ComponentSetTarget (MEDIA, "<DIR_CORE>", TARGETDIR);
211     if (nResult = BACK) goto Dlg_SdShowInfoList;
212
213   endif;
214
215   if (DO_NIGHTLY_BOOL == 1) then
216         MessageBox ("IMPORTANT NOTE ABOUT UPDATE SETUPS:\n" + 
217         "You may be prompted about games that are not installed. This setup is a single update to all the games we support.\n" +
218         "Let the setup select the default paths, and in 'Setup Type' dialog, select custom setup and disable the updates for the games you don't have.", WARNING);
219   endif;
220
221   // ---------------------------------------------------------------------------------
222   // game pack #1
223   if (DO_GAME_Q3_BOOL == 1) then
224 Dlg_SdAskGamePath_Q3:
225     // guess the default game path
226     nKeyType = REGDB_STRING;
227     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
228     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Id\\Quake III Arena\\", "INSTALLPATH", nKeyType, szRegKey, nRegKeySize);
229     if (nRegKey = 0) then
230           FindFile (szRegKey, "quake3.exe", szQuake3);
231           if (szQuake3 = "quake3.exe") then
232             szDIR_GAME_Q3 = szRegKey;
233       else
234         szDIR_GAME_Q3 = @DEFAULTQUAKE3DIR;
235       endif;
236     else
237       szDIR_GAME_Q3 = @DEFAULTQUAKE3DIR;
238     endif;
239
240     // prompt user for game path
241     szTitle = "Quake III Arena / Quake III: Team Arena and mods game package";
242     szMsg   = "Select the folder where Quake III Arena is installed.\nNOTE: For compatibility purposes, your Quake III Arena folder name must contain the word \"quake\" in the top level. eg. C:\\Program Files\\Quake III Arena\n\nTo continue, click Next.";
243     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_Q3, 0 );
244     if (nResult = BACK) then
245       if (DO_CORE_BOOL == 1) then
246         goto Dlg_SdAskCorePath;
247       else
248         goto Dlg_SdShowInfoList;
249       endif;
250     endif;
251
252     // prompt user for game subdir
253 Dlg_SdShowDlgEdit1_Q3:
254     szTitle = "Choose Folder\nEnter a folder name.";
255     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Quake III Arena game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
256     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
257     szDIR_GAMETOOLS_Q3 = szDIR_GAME_Q3 ^ szSubDir;
258     if (nResult = BACK) goto Dlg_SdAskGamePath_Q3;
259
260     // set values in components
261     ComponentSetTarget (MEDIA, "<DIR_GAME_Q3>", szDIR_GAME_Q3);
262     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_Q3>", szDIR_GAMETOOLS_Q3);
263
264   endif;
265
266   // ---------------------------------------------------------------------------------
267   // game pack #2
268   if (DO_GAME_WOLF_BOOL == 1) then
269 Dlg_SdAskGamePath_Wolf:
270
271     nKeyType = REGDB_STRING;
272     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
273     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Return to Castle Wolfenstein - Game of The Year Edition\\", "INSTALLPATH", nKeyType, szRegKey, nRegKeySize);
274     if (nRegKey = 0) then
275       FindFile (szRegKey, "wolfmp.exe", szRTCW);
276       if (szRTCW = "wolfmp.exe") then
277         szDIR_GAME_WOLF = szRegKey;
278       else
279         szDIR_GAME_WOLF = @DEFAULTRTCWDIR;
280       endif;
281     else
282       szDIR_GAME_WOLF = @DEFAULTRTCWDIR;
283     endif;
284
285     // prompt user for game path
286     // NOTE TTimo: only required in full setup actually?
287     szTitle = "Return To Castle Wolfenstein game package";
288     szMsg   = "Select the folder where Return To Castle Wolfenstein is installed.";
289     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_WOLF, 0 );
290     if (nResult = BACK) then
291       if (DO_GAME_Q3_BOOL == 1) then
292         goto Dlg_SdShowDlgEdit1_Q3;
293       elseif (DO_CORE_BOOL == 1) then
294         goto Dlg_SdAskCorePath;
295       else
296         goto Dlg_SdShowInfoList;
297       endif;
298     endif;
299
300     // prompt user for game subdir
301 Dlg_SdShowDlgEdit1_Wolf:
302     szTitle = "Choose Folder\nEnter a folder name.";
303     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Return to Castle Wolfenstein game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
304     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
305     szDIR_GAMETOOLS_WOLF = szDIR_GAME_WOLF ^ szSubDir;
306     if (nResult = BACK) goto Dlg_SdAskGamePath_Wolf;
307
308     // set values in components
309     ComponentSetTarget (MEDIA, "<DIR_GAME_WOLF>", szDIR_GAME_WOLF);
310     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_WOLF>", szDIR_GAMETOOLS_WOLF);
311
312   endif;
313
314   // ---------------------------------------------------------------------------------
315   // game pack #3
316   if (DO_GAME_JKII_BOOL == 1) then
317 Dlg_SdAskGamePath_JKII:
318
319     // guess the default game path from registry
320     DEFAULTJKIIDIR = "C:\\Program Files\\LucasArts\\Star Wars JK II Jedi Outcast\\GameData";
321     nKeyType = REGDB_STRING;
322     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
323     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\LucasArts Entertainment Company LLC\\Star Wars JK II Jedi Outcast\\1.0\\", "Install Path", nKeyType, szRegKey, nRegKeySize);
324     if (nRegKey = 0) then
325           FindFile (szRegKey + "GameData", "jk2sp.exe", szJKII);
326           if (szJKII = "jk2sp.exe") then
327             szDIR_GAME_JKII = szRegKey;
328       else
329         szDIR_GAME_JKII = DEFAULTJKIIDIR;
330       endif;
331     else
332       szDIR_GAME_JKII = DEFAULTJKIIDIR;
333     endif;
334
335     // prompt user for game path
336     szTitle = "Jedi Knight II: Jedi Outcast game package";
337     szMsg   = "Select the folder where Jedi Knight II: Jedi Outcast is installed.";
338     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_JKII, 0 );
339     if (nResult = BACK) then
340       if (DO_GAME_WOLF_BOOL == 1) then
341         goto Dlg_SdShowDlgEdit1_Wolf;
342       elseif (DO_GAME_Q3_BOOL == 1) then
343         goto Dlg_SdShowDlgEdit1_Q3;
344       elseif (DO_CORE_BOOL == 1) then
345         goto Dlg_SdAskCorePath;
346       else
347         goto Dlg_SdShowInfoList;
348       endif;
349     endif;
350
351     // prompt user for game subdir
352 Dlg_SdShowDlgEdit1_JKII:
353     szTitle = "Choose Folder\nEnter a folder name.";
354     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Jedi Knight II: Jedi Outcast game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
355     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
356     szDIR_GAMETOOLS_JKII = szDIR_GAME_JKII ^ szSubDir;
357     if (nResult = BACK) goto Dlg_SdAskGamePath_JKII;
358
359     // set values in components
360     ComponentSetTarget (MEDIA, "<DIR_GAME_JKII>", szDIR_GAME_JKII);
361     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_JKII>", szDIR_GAMETOOLS_JKII);
362
363   endif;
364
365   // ---------------------------------------------------------------------------------
366   // game pack #4
367   if (DO_GAME_STVEF_BOOL == 1) then
368 Dlg_SdAskGamePath_STVEF:
369
370     // guess the default game path from registry
371     DEFAULTSTVEFDIR = "C:\\Program Files\\Raven\\Star Trek Voyager Elite Force\\";
372     nKeyType = REGDB_STRING;
373     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
374     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Star Trek: Voyager - Elite Force\\1.0\\", "Install Path", nKeyType, szRegKey, nRegKeySize);
375     if (nRegKey = 0) then
376           FindFile (szRegKey + "GameData", "stvoy.exe", szSTVEF);
377           if (szSTVEF = "stvoy.exe") then
378             szDIR_GAME_STVEF = szRegKey;
379       else
380         szDIR_GAME_STVEF = DEFAULTSTVEFDIR;
381       endif;
382     else
383       szDIR_GAME_STVEF = DEFAULTSTVEFDIR;
384     endif;
385
386     // prompt user for game path
387     szTitle = "Star Trek Voyage : Elite Force game package";
388     szMsg   = "Select the folder where Star Trek Voyage : Elite Force is installed.";
389     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_STVEF, 0 );
390     if (nResult = BACK) then
391       if (DO_GAME_JKII_BOOL == 1) then
392         goto Dlg_SdShowDlgEdit1_JKII;
393       elseif (DO_GAME_WOLF_BOOL == 1) then
394         goto Dlg_SdShowDlgEdit1_Wolf;
395       elseif (DO_GAME_Q3_BOOL == 1) then
396         goto Dlg_SdShowDlgEdit1_Q3;
397       elseif (DO_CORE_BOOL == 1) then
398         goto Dlg_SdAskCorePath;
399       else
400         goto Dlg_SdShowInfoList;
401       endif;
402     endif;
403
404     // prompt user for game subdir
405 Dlg_SdShowDlgEdit1_STVEF:
406     szTitle = "Choose Folder\nEnter a folder name.";
407     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Star Trek Voyage : Elite Force game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
408     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
409     szDIR_GAMETOOLS_STVEF = szDIR_GAME_STVEF ^ szSubDir;
410     if (nResult = BACK) goto Dlg_SdAskGamePath_STVEF;
411
412     // set values in components
413     ComponentSetTarget (MEDIA, "<DIR_GAME_STVEF>", szDIR_GAME_STVEF);
414     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_STVEF>", szDIR_GAMETOOLS_STVEF);
415
416   endif;
417
418   // ---------------------------------------------------------------------------------  
419   // game pack #5, SofII
420   // ---------------------------------------------------------------------------------
421   if (DO_GAME_SOF2_BOOL == 1) then
422 Dlg_SdAskGamePath_SOF2:
423     
424     // guess the default game path from registry
425     DEFAULTSOF2DIR = "C:\\Program Files\\Soldier of Fortune II - Double Helix\\";
426     nKeyType = REGDB_STRING;
427     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
428     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Soldier of Fortune II - Double Helix\\", "InstallPath", nKeyType, szRegKey, nRegKeySize);
429     if (nRegKey = 0) then
430           FindFile (szRegKey + "GameData", "sof2.exe", szSOF2);
431           if (szSOF2 = "sof2.exe") then
432             szDIR_GAME_SOF2 = szRegKey;
433       else
434         szDIR_GAME_SOF2 = DEFAULTSOF2DIR; 
435       endif;
436     else
437       szDIR_GAME_SOF2 = DEFAULTSOF2DIR; 
438     endif;
439     
440     // prompt user for game path
441     szTitle = "Soldier of Fortune II - Double Helix game package";
442     szMsg   = "Select the folder where Soldier of Fortune II - Double Helix is installed.";
443     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_SOF2, 0 );
444     if (nResult = BACK) then
445       if (DO_GAME_STVEF_BOOL == 1) then
446         goto Dlg_SdShowDlgEdit1_STVEF;
447       elseif (DO_GAME_JKII_BOOL == 1) then
448         goto Dlg_SdShowDlgEdit1_JKII;
449       elseif (DO_GAME_WOLF_BOOL == 1) then
450         goto Dlg_SdShowDlgEdit1_Wolf;
451       elseif (DO_GAME_Q3_BOOL == 1) then
452         goto Dlg_SdShowDlgEdit1_Q3;
453       elseif (DO_CORE_BOOL == 1) then
454         goto Dlg_SdAskCorePath;
455       else
456         goto Dlg_SdShowInfoList;
457       endif;
458     endif;
459     
460     // prompt user for game subdir
461 Dlg_SdShowDlgEdit1_SOF2:
462     szTitle = "Choose Folder\nEnter a folder name.";
463     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Soldier of Fortune II - Double Helix game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
464     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
465     szDIR_GAMETOOLS_SOF2 = szDIR_GAME_SOF2 ^ szSubDir;
466     if (nResult = BACK) goto Dlg_SdAskGamePath_SOF2;
467     
468     // set values in components
469     ComponentSetTarget (MEDIA, "<DIR_GAME_SOF2>", szDIR_GAME_SOF2);
470     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_SOF2>", szDIR_GAMETOOLS_SOF2);
471     
472   endif;
473
474   // ---------------------------------------------------------------------------------
475   // game pack #6
476   // Hydra: note, for addition game packs, do NOT copy this one.
477   if (DO_GAME_HALFLIFE_BOOL == 1) then
478 Dlg_SdAskGamePath_HALFLIFE:
479
480     // for halflife/cs put the default in first, then override
481     DEFAULTHALFLIFEDIR = "C:\\Sierra\\Half-Life\\";
482     szDIR_GAME_HALFLIFE = DEFAULTHALFLIFEDIR;
483     // for the .game file generation we need a flag.
484     DO_GAME_CSTRIKE_BOOL = 0;
485
486     // guess the default game path (Counter Strike Retail)
487     nKeyType = REGDB_STRING;
488     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
489     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Sierra OnLine\\Setup\\CSTRIKE\\", "Directory", nKeyType, szRegKey, nRegKeySize);
490     if (nRegKey = 0) then
491           FindFile (szRegKey, "cstrike.exe", szCStrike);
492           if (szCStrike = "cstrike.exe") then
493             szDIR_GAME_HALFLIFE = szRegKey;
494             DO_GAME_CSTRIKE_BOOL = 1; // set the flag
495           endif;
496     endif;
497
498         if (szDIR_GAME_HALFLIFE = DEFAULTHALFLIFEDIR) then
499           // guess the default game path (HalfLife)
500           nKeyType = REGDB_STRING;
501           RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
502           nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Sierra OnLine\\Setup\\HALFLIFE\\", "Directory", nKeyType, szRegKey, nRegKeySize);
503           if (nRegKey = 0) then
504             FindFile (szRegKey, "hl.exe", szHL);
505                 if (szHL = "hl.exe") then
506                   szDIR_GAME_HALFLIFE = szRegKey;
507         endif;
508           endif;
509         endif;
510
511     // prompt user for game path
512     szTitle = "Halflife / Counterstrike-Retail and mods game package";
513     szMsg   = "Select the folder where Halflife or Counterstrike-Retail is installed.\nclick Next.";
514     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_HALFLIFE, 0 );
515     if (nResult = BACK) then
516       if (DO_GAME_SOF2_BOOL == 1) then
517         goto Dlg_SdShowDlgEdit1_SOF2;
518       elseif (DO_GAME_STVEF_BOOL == 1) then
519         goto Dlg_SdShowDlgEdit1_STVEF;
520       elseif (DO_GAME_JKII_BOOL == 1) then
521         goto Dlg_SdShowDlgEdit1_JKII;
522       elseif (DO_GAME_WOLF_BOOL == 1) then
523         goto Dlg_SdShowDlgEdit1_Wolf;
524       elseif (DO_GAME_Q3_BOOL == 1) then
525         goto Dlg_SdShowDlgEdit1_Q3;
526       elseif (DO_CORE_BOOL == 1) then
527         goto Dlg_SdAskCorePath;
528       else
529         goto Dlg_SdShowInfoList;
530       endif;
531     endif;
532
533     // prompt user for game subdir
534 Dlg_SdShowDlgEdit1_HALFLIFE:
535     szTitle = "Choose Folder\nEnter a folder name.";
536     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Halflife game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
537     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
538     szDIR_GAMETOOLS_HALFLIFE = szDIR_GAME_HALFLIFE ^ szSubDir;
539     if (nResult = BACK) goto Dlg_SdAskGamePath_HALFLIFE;
540
541     // set values in components
542     ComponentSetTarget (MEDIA, "<DIR_GAME_HALFLIFE>", szDIR_GAME_HALFLIFE);
543     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_HALFLIFE>", szDIR_GAMETOOLS_HALFLIFE);
544
545   endif;
546
547   // ---------------------------------------------------------------------------------  
548   // game pack #7, ET
549   // ---------------------------------------------------------------------------------
550   if (DO_GAME_ET_BOOL == 1) then
551 Dlg_SdAskGamePath_ET:
552     
553     // guess the default game path from registry
554     DEFAULTETDIR = "C:\\Program Files\\Wolfenstein - Enemy Territory\\";
555     nKeyType = REGDB_STRING;
556     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
557     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Wolfenstein - Enemy Territory\\", "InstallPath", nKeyType, szRegKey, nRegKeySize);
558     if (nRegKey = 0) then
559           FindFile (szRegKey + "GameData", "ET.exe", szET);
560           if (szET = "ET.exe") then
561             szDIR_GAME_ET = szRegKey;
562       else
563         szDIR_GAME_ET = DEFAULTETDIR; 
564       endif;
565     else
566       szDIR_GAME_ET = DEFAULTETDIR; 
567     endif;
568     
569     // prompt user for game path
570     szTitle = "Wolfenstein: Enemy Territory game package";
571     szMsg   = "Select the folder where Wolfenstein: Enemy Territory is installed.";
572     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_ET, 0 );
573     if (nResult = BACK) then
574       if (DO_GAME_HALFLIFE_BOOL == 1) then
575         goto Dlg_SdShowDlgEdit1_HALFLIFE;
576       elseif (DO_GAME_STVEF_BOOL == 1) then
577         goto Dlg_SdShowDlgEdit1_STVEF;
578       elseif (DO_GAME_JKII_BOOL == 1) then
579         goto Dlg_SdShowDlgEdit1_JKII;
580       elseif (DO_GAME_WOLF_BOOL == 1) then
581         goto Dlg_SdShowDlgEdit1_Wolf;
582       elseif (DO_GAME_Q3_BOOL == 1) then
583         goto Dlg_SdShowDlgEdit1_Q3;
584       elseif (DO_CORE_BOOL == 1) then
585         goto Dlg_SdAskCorePath;
586       else
587         goto Dlg_SdShowInfoList;
588       endif;
589     endif;
590     
591     // prompt user for game subdir
592 Dlg_SdShowDlgEdit1_ET:
593     szTitle = "Choose Folder\nEnter a folder name.";
594     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Wolfenstein: Enemy Territory game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
595     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
596     szDIR_GAMETOOLS_ET = szDIR_GAME_ET ^ szSubDir;
597     if (nResult = BACK) goto Dlg_SdAskGamePath_ET;
598     
599     // set values in components
600     ComponentSetTarget (MEDIA, "<DIR_GAME_ET>", szDIR_GAME_ET);
601     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_ET>", szDIR_GAMETOOLS_ET);
602     
603   endif;
604
605   // ---------------------------------------------------------------------------------  
606   // game pack #8, Quake
607   // ---------------------------------------------------------------------------------
608   if (DO_GAME_Q1_BOOL == 1) then
609 Dlg_SdAskGamePath_Q1:
610     
611     // guess the default game path from registry
612     DEFAULTQ1DIR = "C:\\quake\\";
613
614         FindFile (szRegKey + "GameData", "quake.exe", szQ1);
615         if (szQ1 = "quake.exe") then
616           szDIR_GAME_Q1 = szRegKey;
617     else
618       szDIR_GAME_Q1 = DEFAULTQ1DIR; 
619     endif;
620     
621     // prompt user for game path
622     szTitle = "Quake game package";
623     szMsg   = "Select the folder where Quake is installed.";
624     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_Q1, 0 );
625     if (nResult = BACK) then
626       if (DO_GAME_ET_BOOL == 1) then
627         goto Dlg_SdShowDlgEdit1_ET;
628       elseif (DO_GAME_HALFLIFE_BOOL == 1) then
629         goto Dlg_SdShowDlgEdit1_HALFLIFE;
630       elseif (DO_GAME_SOF2_BOOL == 1) then
631         goto Dlg_SdShowDlgEdit1_SOF2;
632       elseif (DO_GAME_STVEF_BOOL == 1) then
633         goto Dlg_SdShowDlgEdit1_STVEF;
634       elseif (DO_GAME_JKII_BOOL == 1) then
635         goto Dlg_SdShowDlgEdit1_JKII;
636       elseif (DO_GAME_WOLF_BOOL == 1) then
637         goto Dlg_SdShowDlgEdit1_Wolf;
638       elseif (DO_GAME_Q3_BOOL == 1) then
639         goto Dlg_SdShowDlgEdit1_Q3;
640       elseif (DO_CORE_BOOL == 1) then
641         goto Dlg_SdAskCorePath;
642       else
643         goto Dlg_SdShowInfoList;
644       endif;
645     endif;
646     
647     // prompt user for game subdir
648 Dlg_SdShowDlgEdit1_Q1:
649     szTitle = "Choose Folder\nEnter a folder name.";
650     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Quake game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
651     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
652     szDIR_GAMETOOLS_Q1 = szDIR_GAME_Q1 ^ szSubDir;
653     if (nResult = BACK) goto Dlg_SdAskGamePath_Q1;
654     
655     // set values in components
656     ComponentSetTarget (MEDIA, "<DIR_GAME_Q1>", szDIR_GAME_Q1);
657     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_Q1>", szDIR_GAMETOOLS_Q1);
658     
659   endif;
660
661   // ---------------------------------------------------------------------------------  
662   // game pack #8, JA
663   if (DO_GAME_JA_BOOL == 1) then
664 Dlg_SdAskGamePath_JA:
665     
666     // guess the default game path from registry
667     DEFAULTJADIR = "C:\\Program Files\\LucasArts\\Star Wars Jedi Knight Jedi Academy\\GameData";
668     nKeyType = REGDB_STRING;
669     RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
670     nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\LucasArts\\Star Wars Jedi Knight Jedi Academy\\1.0\\", "Install Path", nKeyType, szRegKey, nRegKeySize);
671     if (nRegKey = 0) then
672           FindFile (szRegKey + "GameData", "jasp.exe", szJKII);
673           if (szJKII = "jasp.exe") then
674             szDIR_GAME_JA = szRegKey;
675       else
676         szDIR_GAME_JA = DEFAULTJADIR;
677       endif;
678     else
679       szDIR_GAME_JA = DEFAULTJADIR;
680     endif;
681     
682     // prompt user for game path
683     szTitle = "Star Wars Jedi Knight Jedi Academy";
684     szMsg   = "Select the folder where Star Wars Jedi Knight Jedi Academy is installed.";
685     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_JA, 0 );
686     if (nResult = BACK) then
687       if (DO_GAME_Q1_BOOL == 1) then
688         goto Dlg_SdShowDlgEdit1_Q1;
689       elseif (DO_GAME_ET_BOOL == 1) then
690         goto Dlg_SdShowDlgEdit1_ET;
691       elseif (DO_GAME_HALFLIFE_BOOL == 1) then
692         goto Dlg_SdShowDlgEdit1_HALFLIFE;
693       elseif (DO_GAME_SOF2_BOOL == 1) then
694         goto Dlg_SdShowDlgEdit1_SOF2;
695       elseif (DO_GAME_STVEF_BOOL == 1) then
696         goto Dlg_SdShowDlgEdit1_STVEF;
697       elseif (DO_GAME_JKII_BOOL == 1) then
698         goto Dlg_SdShowDlgEdit1_JKII;
699       elseif (DO_GAME_WOLF_BOOL == 1) then
700         goto Dlg_SdShowDlgEdit1_Wolf;
701       elseif (DO_GAME_Q3_BOOL == 1) then
702         goto Dlg_SdShowDlgEdit1_Q3;
703       elseif (DO_CORE_BOOL == 1) then
704         goto Dlg_SdAskCorePath;
705       else
706         goto Dlg_SdShowInfoList;
707       endif;
708     endif;
709     
710     // prompt user for game subdir
711 Dlg_SdShowDlgEdit1_JA:
712     szTitle = "Choose Folder\nEnter a folder name.";
713     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Star Wars Jedi Knight Jedi Academy game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
714     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
715     szDIR_GAMETOOLS_JA = szDIR_GAME_JA ^ szSubDir;
716     if (nResult = BACK) goto Dlg_SdAskGamePath_JA;
717     
718     // set values in components
719     ComponentSetTarget (MEDIA, "<DIR_GAME_JA>", szDIR_GAME_JA);
720     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_JA>", szDIR_GAMETOOLS_JA);
721     
722   endif;
723
724   // ---------------------------------------------------------------------------------  
725   // game pack #9, Q2
726   // ---------------------------------------------------------------------------------
727   if (DO_GAME_Q2_BOOL == 1) then
728 Dlg_SdAskGamePath_Q2:
729     
730     // guess the default game path from registry
731     szDIR_GAME_Q2 = "C:\\Quake2\\";
732     
733     // prompt user for game path
734     szTitle = "Quake II";
735     szMsg   = "Select the folder where Quake II is installed.";
736     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_Q2, 0 );
737     if (nResult = BACK) then
738       if (DO_GAME_JA_BOOL == 1) then
739         goto Dlg_SdShowDlgEdit1_JA;
740       elseif (DO_GAME_Q1_BOOL == 1) then
741         goto Dlg_SdShowDlgEdit1_Q1;
742       elseif (DO_GAME_ET_BOOL == 1) then
743         goto Dlg_SdShowDlgEdit1_ET;
744       elseif (DO_GAME_HALFLIFE_BOOL == 1) then
745         goto Dlg_SdShowDlgEdit1_HALFLIFE;
746       elseif (DO_GAME_STVEF_BOOL == 1) then
747         goto Dlg_SdShowDlgEdit1_STVEF;
748       elseif (DO_GAME_JKII_BOOL == 1) then
749         goto Dlg_SdShowDlgEdit1_JKII;
750       elseif (DO_GAME_WOLF_BOOL == 1) then
751         goto Dlg_SdShowDlgEdit1_Wolf;
752       elseif (DO_GAME_Q3_BOOL == 1) then
753         goto Dlg_SdShowDlgEdit1_Q3;
754       elseif (DO_CORE_BOOL == 1) then
755         goto Dlg_SdAskCorePath;
756       else
757         goto Dlg_SdShowInfoList;
758       endif;
759     endif;
760     
761     // prompt user for game subdir
762 Dlg_SdShowDlgEdit1_Q2:
763     szTitle = "Choose Folder\nEnter a folder name.";
764     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Quake II game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
765     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
766     szDIR_GAMETOOLS_Q2 = szDIR_GAME_Q2 ^ szSubDir;
767     if (nResult = BACK) goto Dlg_SdAskGamePath_Q2;
768     
769     // set values in components
770     ComponentSetTarget (MEDIA, "<DIR_GAME_Q2>", szDIR_GAME_Q2);
771     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_Q2>", szDIR_GAMETOOLS_Q2);
772     
773   endif;
774
775   // ---------------------------------------------------------------------------------  
776   // game pack #10, HER2
777   // ---------------------------------------------------------------------------------
778   if (DO_GAME_HER2_BOOL == 1) then
779 Dlg_SdAskGamePath_HER2:
780     
781     // guess the default game path from registry
782     szDIR_GAME_HER2 = "C:\\Heretic2\\";
783     
784     // prompt user for game path
785     szTitle = "Heretic II";
786     szMsg   = "Select the folder where Heretic II is installed.";
787     nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_HER2, 0 );
788     if (nResult = BACK) then
789       if (DO_GAME_Q2_BOOL == 1) then
790         goto Dlg_SdShowDlgEdit1_Q2;
791       elseif (DO_GAME_JA_BOOL == 1) then
792         goto Dlg_SdShowDlgEdit1_JA;
793       elseif (DO_GAME_Q1_BOOL == 1) then
794         goto Dlg_SdShowDlgEdit1_Q1;
795       elseif (DO_GAME_ET_BOOL == 1) then
796         goto Dlg_SdShowDlgEdit1_ET;
797       elseif (DO_GAME_HALFLIFE_BOOL == 1) then
798         goto Dlg_SdShowDlgEdit1_HALFLIFE;
799       elseif (DO_GAME_STVEF_BOOL == 1) then
800         goto Dlg_SdShowDlgEdit1_STVEF;
801       elseif (DO_GAME_JKII_BOOL == 1) then
802         goto Dlg_SdShowDlgEdit1_JKII;
803       elseif (DO_GAME_WOLF_BOOL == 1) then
804         goto Dlg_SdShowDlgEdit1_Wolf;
805       elseif (DO_GAME_Q3_BOOL == 1) then
806         goto Dlg_SdShowDlgEdit1_Q3;
807       elseif (DO_CORE_BOOL == 1) then
808         goto Dlg_SdAskCorePath;
809       else
810         goto Dlg_SdShowInfoList;
811       endif;
812     endif;
813     
814     // prompt user for game subdir
815 Dlg_SdShowDlgEdit1_HER2:
816     szTitle = "Choose Folder\nEnter a folder name.";
817     szMsg   = "Please enter the folder name for " + @PRODUCT_NAME + " Heretic II game pack in the edit field below.\nNOTE: This is for installation of the game specific files.";
818     nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir);
819     szDIR_GAMETOOLS_HER2 = szDIR_GAME_HER2 ^ szSubDir;
820     if (nResult = BACK) goto Dlg_SdAskGamePath_HER2;
821     
822     // set values in components
823     ComponentSetTarget (MEDIA, "<DIR_GAME_HER2>", szDIR_GAME_HER2);
824     ComponentSetTarget (MEDIA, "<DIR_GAMETOOLS_HER2>", szDIR_GAMETOOLS_HER2);
825     
826   endif;
827
828   // ---------------------------------------------------------------------------------
829   // game pack #11, 'TODO: add your game pack here'
830   // ---------------------------------------------------------------------------------
831
832   // prompt for typical, custom etc. install
833 Dlg_SetupType:
834     szTitle    = "";
835     szMsg      = "";
836     nResult = SdSetupTypeEx (szTitle, szMsg, "", svSetupType, 0);
837     if (nResult = BACK) then
838       // FIXME TTimo wish we could stick labels into variables instead?
839       if (DO_GAME_HER2_BOOL == 1) then
840         goto Dlg_SdShowDlgEdit1_HER2;
841       elseif (DO_GAME_Q2_BOOL == 1) then
842         goto Dlg_SdShowDlgEdit1_Q2;
843       elseif (DO_GAME_JA_BOOL == 1) then
844         goto Dlg_SdShowDlgEdit1_JA;
845       elseif (DO_GAME_Q1_BOOL == 1) then
846         goto Dlg_SdShowDlgEdit1_Q1;
847       elseif (DO_GAME_ET_BOOL == 1) then
848         goto Dlg_SdShowDlgEdit1_ET;
849       elseif (DO_GAME_HALFLIFE_BOOL == 1) then
850         goto Dlg_SdShowDlgEdit1_HALFLIFE;
851       elseif (DO_GAME_SOF2_BOOL == 1) then
852         goto Dlg_SdShowDlgEdit1_SOF2;
853       elseif (DO_GAME_STVEF_BOOL == 1) then
854         goto Dlg_SdShowDlgEdit1_STVEF;
855       elseif (DO_GAME_JKII_BOOL == 1) then
856         goto Dlg_SdShowDlgEdit1_JKII;
857       elseif (DO_GAME_WOLF_BOOL == 1) then
858         goto Dlg_SdShowDlgEdit1_Wolf;
859       elseif (DO_GAME_Q3_BOOL == 1) then
860         goto Dlg_SdShowDlgEdit1_Q3;
861       elseif (DO_CORE_BOOL == 1) then
862         goto Dlg_SdAskCorePath;
863       else
864         goto Dlg_SdShowInfoList;
865       endif;
866     endif;
867     if (svSetupType = "custom") then
868         nResult = CUSTOM;
869     endif;
870     nSetupType = nResult;
871
872 Dlg_SdComponentTree:
873     if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
874     szTitle    = "";
875     szMsg      = "";
876     szTargetdir = TARGETDIR;
877     szComponents = "";
878     nLevel = 2;
879     if (nSetupType = CUSTOM) then
880                     nResult = SdComponentTree(szTitle, szMsg, szTargetdir, szComponents, nLevel);
881                     if (nResult = BACK) goto Dlg_SetupType;
882     endif;
883
884 Dlg_ObjDialogs:
885     nResult = ShowObjWizardPages(nResult);
886     if (nResult = BACK) goto Dlg_SdComponentTree;
887
888 Dlg_SdSelectFolder:
889     szfolder = @FOLDER_NAME;
890     szTitle    = "";
891     szMsg      = "";
892     nResult    = SdSelectFolder( szTitle, szMsg, szfolder );
893     SHELL_OBJECT_FOLDER = szfolder;
894     if (nResult = BACK) goto Dlg_ObjDialogs;
895
896   // push the list of stuff
897 Dlg_SdStartCopy:
898     szTitle = "";
899     szMsg   = "";
900     listStartCopy = ListCreate( STRINGLIST );
901     if (DO_CORE_BOOL == 1) then
902       ListAddString(listStartCopy,@PRODUCT_NAME + " core installation directory:",AFTER);
903       ListAddString(listStartCopy,"     " + TARGETDIR,AFTER);
904     endif;
905     if (DO_GAME_Q3_BOOL == 1) then
906       ListAddString(listStartCopy,"Quake III Arena folder:",AFTER);
907       ListAddString(listStartCopy,"             " + szDIR_GAME_Q3,AFTER);
908       ListAddString(listStartCopy,"Quake III Arena mapping package folder:",AFTER);
909       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_Q3,AFTER);
910     endif;
911     if (DO_GAME_WOLF_BOOL == 1) then
912       ListAddString(listStartCopy,"Return To Castle Wolfenstein folder:",AFTER);
913       ListAddString(listStartCopy,"             " + szDIR_GAME_WOLF,AFTER);
914       ListAddString(listStartCopy,"Return To Castle Wolfenstein mapping package folder:",AFTER);
915       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_WOLF,AFTER);
916     endif;
917     if (DO_GAME_JKII_BOOL == 1) then
918       ListAddString(listStartCopy,"Jedi Knight II: Jedi Outcast folder:",AFTER);
919       ListAddString(listStartCopy,"             " + szDIR_GAME_JKII,AFTER);
920       ListAddString(listStartCopy,"Jedi Knight II: Jedi Outcast mapping package folder:",AFTER);
921       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_JKII,AFTER);
922     endif;
923     if (DO_GAME_STVEF_BOOL == 1) then
924       ListAddString(listStartCopy,"Star Trek Voyager : Elite Force folder:",AFTER);
925       ListAddString(listStartCopy,"             " + szDIR_GAME_STVEF,AFTER);
926       ListAddString(listStartCopy,"Star Trek Voyager : Elite Force mapping package folder:",AFTER);
927       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_STVEF,AFTER);
928     endif;
929     if (DO_GAME_SOF2_BOOL == 1) then
930       ListAddString(listStartCopy,"Soldier of Fortune II - Double Helix folder:",AFTER);
931       ListAddString(listStartCopy,"             " + szDIR_GAME_SOF2,AFTER);
932       ListAddString(listStartCopy,"Soldier of Fortune II - Double Helix mapping package folder:",AFTER);
933       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_SOF2,AFTER);
934     endif;
935     if (DO_GAME_HALFLIFE_BOOL == 1) then
936       ListAddString(listStartCopy,"Halflife or CounterStrike-Retail folder:",AFTER);
937       ListAddString(listStartCopy,"             " + szDIR_GAME_HALFLIFE,AFTER);
938       ListAddString(listStartCopy,"Halflife or CounterStrike-Retail mapping package folder:",AFTER);
939       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_HALFLIFE,AFTER);
940     endif;
941     if (DO_GAME_ET_BOOL == 1) then
942       ListAddString(listStartCopy,"Wolfenstein: Enemy Territory folder:",AFTER);
943       ListAddString(listStartCopy,"     " + szDIR_GAME_ET,AFTER);
944       ListAddString(listStartCopy,"Wolfenstein: Enemy Territory mapping package folder:",AFTER);
945       ListAddString(listStartCopy,"     " + szDIR_GAMETOOLS_ET,AFTER);
946     endif;
947     if (DO_GAME_Q1_BOOL == 1) then
948       ListAddString(listStartCopy,"Quake folder:",AFTER);
949       ListAddString(listStartCopy,"     " + szDIR_GAME_Q1,AFTER);
950       ListAddString(listStartCopy,"Quake mapping package folder:",AFTER);
951       ListAddString(listStartCopy,"     " + szDIR_GAMETOOLS_Q1,AFTER);
952     endif;
953     if (DO_GAME_JA_BOOL == 1) then
954       ListAddString(listStartCopy,"Star Wars Jedi Knight Jedi Academy folder:",AFTER);
955       ListAddString(listStartCopy,"     " + szDIR_GAME_JA,AFTER);
956       ListAddString(listStartCopy,"Star Wars Jedi Knight Jedi Academy mapping package folder:",AFTER);
957       ListAddString(listStartCopy,"     " + szDIR_GAMETOOLS_JA,AFTER);
958     endif;
959     if (DO_GAME_Q2_BOOL == 1) then
960       ListAddString(listStartCopy,"Quake II folder:",AFTER);
961       ListAddString(listStartCopy,"     " + szDIR_GAME_Q2,AFTER);
962       ListAddString(listStartCopy,"Quake II mapping package folder:",AFTER);
963       ListAddString(listStartCopy,"     " + szDIR_GAMETOOLS_Q2,AFTER);
964     endif;
965     if (DO_GAME_HER2_BOOL == 1) then
966       ListAddString(listStartCopy,"Heretic II folder:",AFTER);
967       ListAddString(listStartCopy,"     " + szDIR_GAME_HER2,AFTER);
968       ListAddString(listStartCopy,"Heretic II mapping package folder:",AFTER);
969       ListAddString(listStartCopy,"     " + szDIR_GAMETOOLS_HER2,AFTER);
970     endif;
971     ListAddString(listStartCopy,"Setup type: ",AFTER);
972     ListAddString(listStartCopy,"               " + svSetupType,AFTER);
973     nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
974     ListDestroy(listStartCopy);
975     if (nResult = BACK) goto Dlg_SdSelectFolder;
976
977     // setup default status
978     SetStatusWindow(0, "");
979     Enable(STATUSEX);
980     StatusUpdate(ON, 100);
981
982
983   return 0;
984 end;
985
986 ///////////////////////////////////////////////////////////////////////////////
987 //
988 //  FUNCTION:   OnMoving
989 //
990 //  EVENT:      Moving event is sent when file transfer is started as a result of
991 //              ComponentTransferData call, before any file transfer operations
992 //              are performed.
993 //
994 ///////////////////////////////////////////////////////////////////////////////
995 function OnMoving()
996     STRING szAppPath;
997 begin
998     // Set LOGO Compliance Application Path
999     // NOTE TTimo
1000     // doc on RegDBSetItem says before calling you must call the InstallationInfo
1001     // function, which provides information used to create the key
1002     szAppPath = TARGETDIR;
1003     RegDBSetItem(REGDB_APPPATH, szAppPath);
1004     RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
1005 end;
1006
1007 /////////////////////////////////////////////////////////////////////////////////
1008 // The OnMoved event handler responds to the Moved event that is generated just
1009 // after all selected components have been installed or uninstalled on the
1010 // target computer.
1011 /////////////////////////////////////////////////////////////////////////////////
1012
1013 function OnMoved()
1014   NUMBER nvFileHandle;
1015 begin
1016   if !MAINTENANCE then
1017     // generate RADIANT_MAJOR and RADIANT_MINOR file items
1018     if (CreateFile(nvFileHandle, TARGETDIR, "RADIANT_MAJOR")< 0) then
1019       MessageBox ("CreateFile " + TARGETDIR + "\\RADIANT_MAJOR failed.", SEVERE);
1020       abort;
1021     endif;
1022     // template
1023     WriteLine(nvFileHandle, "<<RADIANT_MAJOR>>");
1024     CloseFile(nvFileHandle);
1025     if (CreateFile(nvFileHandle, TARGETDIR, "RADIANT_MINOR")< 0) then
1026       MessageBox ("CreateFile " + TARGETDIR + "\\RADIANT_MINOR failed.", SEVERE);
1027       abort;
1028     endif;
1029     // template
1030     WriteLine(nvFileHandle, "<<RADIANT_MINOR>>");
1031     CloseFile(nvFileHandle);
1032     // generate the config files for the game packages
1033     // NOTE: we are directly creating them, not using XCopyFile
1034     //   that means those won't be uninstalled, doesn't look like a big problem to me
1035     if (DO_GAME_Q3_BOOL == 1) then
1036       if (CreateDir(TARGETDIR ^ "games")< 0) then
1037          // Report the error; then abort.
1038          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1039          abort;
1040       endif;
1041       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "q3.game")< 0) then
1042         // Report the error.
1043         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\q3.game failed.", SEVERE);
1044         abort;
1045       endif;
1046       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1047       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1048       WriteLine(nvFileHandle, "<game");
1049       WriteLine(nvFileHandle, "  name=\"Quake III Arena / Quake III: Team Arena and modifications\"");
1050       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_Q3 + "/\"");
1051       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_Q3 + "/\"");
1052       WriteLine(nvFileHandle, "  gamename=\"quake3\"");
1053       WriteLine(nvFileHandle, "/>");
1054       CloseFile(nvFileHandle);
1055     endif;
1056     if (DO_GAME_WOLF_BOOL == 1) then
1057       if (CreateDir(TARGETDIR ^ "games")< 0) then
1058          // Report the error; then abort.
1059          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1060          abort;
1061       endif;
1062       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "wolf.game")< 0) then
1063         // Report the error.
1064         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\wolf.game failed.", SEVERE);
1065         abort;
1066       endif;
1067       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1068       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1069       WriteLine(nvFileHandle, "<game");
1070       WriteLine(nvFileHandle, "  name=\"Return To Castle Wolfenstein\"");
1071       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_WOLF + "/\"");
1072       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_WOLF + "/\"");
1073       WriteLine(nvFileHandle, "  basegame=\"main\"");
1074       WriteLine(nvFileHandle, "  engine=\"WolfSP.exe\"");
1075       WriteLine(nvFileHandle, "  gamename=\"wolf\"");
1076       WriteLine(nvFileHandle, "/>");
1077       CloseFile(nvFileHandle);
1078     endif;
1079     if (DO_GAME_JKII_BOOL == 1) then
1080       if (CreateDir(TARGETDIR ^ "games")< 0) then
1081          // Report the error; then abort.
1082          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1083          abort;
1084       endif;
1085       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "jk2.game")< 0) then
1086         // Report the error.
1087         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\jk2.game failed.", SEVERE);
1088         abort;
1089       endif;
1090       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1091       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1092       WriteLine(nvFileHandle, "<game");
1093       WriteLine(nvFileHandle, "  name=\"Jedi Knight II: Jedi Outcast\"");
1094       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_JKII + "/\"");
1095       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_JKII + "/\"");
1096       WriteLine(nvFileHandle, "  basegame=\"base\"");
1097       WriteLine(nvFileHandle, "  engine=\"jk2sp.exe\"");
1098       WriteLine(nvFileHandle, "  shaderpath=\"shaders/\"");
1099       WriteLine(nvFileHandle, "  default_scale=\"0.25\"");
1100       WriteLine(nvFileHandle, "  gamename=\"jk2\"");
1101       WriteLine(nvFileHandle, "/>");
1102       CloseFile(nvFileHandle);
1103     endif;
1104     if (DO_GAME_STVEF_BOOL == 1) then
1105       if (CreateDir(TARGETDIR ^ "games")< 0) then
1106          // Report the error; then abort.
1107          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1108          abort;
1109       endif;
1110       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "stvef.game")< 0) then
1111         // Report the error.
1112         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\stvef.game failed.", SEVERE);
1113         abort;
1114       endif;
1115       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1116       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1117       WriteLine(nvFileHandle, "<game");
1118       WriteLine(nvFileHandle, "  name=\"Star Trek Voyager : Elite Force\"");
1119       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_STVEF + "/\"");
1120       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_STVEF + "/\"");
1121       WriteLine(nvFileHandle, "  basegame=\"baseEF\"");
1122       WriteLine(nvFileHandle, "  engine=\"stvoy.exe\"");
1123       WriteLine(nvFileHandle, "  gamename=\"stvef\"");
1124       WriteLine(nvFileHandle, "/>");
1125       CloseFile(nvFileHandle);
1126     endif;
1127     if (DO_GAME_SOF2_BOOL == 1) then
1128       if (CreateDir(TARGETDIR ^ "games")< 0) then
1129          // Report the error; then abort.
1130          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1131          abort;
1132       endif;
1133       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "sof2.game")< 0) then
1134         // Report the error.
1135         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\sof2.game failed.", SEVERE);
1136         abort;
1137       endif;
1138       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1139       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1140       WriteLine(nvFileHandle, "<game");
1141       WriteLine(nvFileHandle, "  name=\"Soldier of Fortune II - Double Helix\"");
1142       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_SOF2 + "/\"");
1143       WriteLine(nvFileHandle, "  basegame=\"base\"");
1144       WriteLine(nvFileHandle, "  engine=\"sof2.exe\"");
1145       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_SOF2 + "/\"");
1146       WriteLine(nvFileHandle, "  shaderpath=\"shaders/\"");
1147       WriteLine(nvFileHandle, "  default_scale=\"0.125\"");
1148       WriteLine(nvFileHandle, "  caulk_shader=\"textures/tools/caulk\"");
1149       WriteLine(nvFileHandle, "/>");
1150       CloseFile(nvFileHandle);
1151     endif;
1152     if (DO_GAME_HALFLIFE_BOOL == 1) then
1153       if (CreateDir(TARGETDIR ^ "games")< 0) then
1154          // Report the error; then abort.
1155          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1156          abort;
1157       endif;
1158       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "hl.game")< 0) then
1159         // Report the error.
1160         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\hl.game failed.", SEVERE);
1161         abort;
1162       endif;
1163       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1164       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1165       WriteLine(nvFileHandle, "<game");
1166       if (DO_GAME_CSTRIKE_BOOL == 1) then
1167         WriteLine(nvFileHandle, "  name=\"Counter-Strike Retail\"");
1168         WriteLine(nvFileHandle, "  engine=\"cstrike.exe\"");
1169       else
1170         WriteLine(nvFileHandle, "  name=\"Halflife and Modifications\"");
1171         WriteLine(nvFileHandle, "  engine=\"hl.exe\"");
1172       endif;
1173       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_HALFLIFE + "/\"");
1174       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_HALFLIFE + "/\"");
1175       WriteLine(nvFileHandle, "  basegame=\"valve\"");
1176       WriteLine(nvFileHandle, "  gamename=\"halflife\"");
1177       WriteLine(nvFileHandle, "  eclass_singleload=\"1\"");
1178       WriteLine(nvFileHandle, "  no_patch=\"1\"");
1179       WriteLine(nvFileHandle, "  default_scale=\"1.0\"");
1180       WriteLine(nvFileHandle, "/>");
1181       CloseFile(nvFileHandle);
1182     endif;
1183     if (DO_GAME_ET_BOOL == 1) then
1184       if (CreateDir(TARGETDIR ^ "games")< 0) then
1185          // Report the error; then abort.
1186          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1187          abort;
1188       endif;
1189       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "et.game")< 0) then
1190         // Report the error.
1191         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\et.game failed.", SEVERE);
1192         abort;
1193       endif;
1194       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1195       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1196       WriteLine(nvFileHandle, "<game");
1197       WriteLine(nvFileHandle, "  name=\"Wolfenstein: Enemy Territory\"");
1198       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_ET + "/\"");
1199       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_ET + "/\"");
1200       WriteLine(nvFileHandle, "  basegame=\"etmain\"");
1201       WriteLine(nvFileHandle, "  engine=\"ET.exe\"");
1202       WriteLine(nvFileHandle, "  gamename=\"et\"");
1203       WriteLine(nvFileHandle, "/>");
1204       CloseFile(nvFileHandle);
1205     endif;
1206     if (DO_GAME_Q1_BOOL == 1) then
1207       if (CreateDir(TARGETDIR ^ "games")< 0) then
1208          // Report the error; then abort.
1209          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1210          abort;
1211       endif;
1212       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "q1.game")< 0) then
1213         // Report the error.
1214         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\q1.game failed.", SEVERE);
1215         abort;
1216       endif;
1217       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1218       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1219       WriteLine(nvFileHandle, "<game");
1220       WriteLine(nvFileHandle, "  name=\"Quake\"");
1221       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_Q1 + "/\"");
1222       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_Q1 + "/\"");
1223       WriteLine(nvFileHandle, "  basegame=\"id1\"");
1224       WriteLine(nvFileHandle, "  engine=\"quake.exe\"");
1225       WriteLine(nvFileHandle, "  gamename=\"q1\"");
1226       WriteLine(nvFileHandle, "  default_scale=\"1.0\"");
1227       WriteLine(nvFileHandle, "/>");
1228       CloseFile(nvFileHandle);
1229     endif;
1230     if (DO_GAME_JA_BOOL == 1) then
1231       if (CreateDir(TARGETDIR ^ "games")< 0) then
1232          // Report the error; then abort.
1233          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1234          abort;
1235       endif;
1236       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "ja.game")< 0) then
1237         // Report the error.
1238         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\ja.game failed.", SEVERE);
1239         abort;
1240       endif;
1241       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1242       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1243       WriteLine(nvFileHandle, "<game");
1244       WriteLine(nvFileHandle, "  name=\"Jedi Knight Jedi Academy\"");
1245       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_JA + "/\"");
1246       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_JA + "/\"");
1247       WriteLine(nvFileHandle, "  basegame=\"base\"");
1248       WriteLine(nvFileHandle, "  engine=\"jasp.exe\"");
1249       WriteLine(nvFileHandle, "  shaderpath=\"shaders/\"");
1250       WriteLine(nvFileHandle, "  default_scale=\"0.25\"");
1251       WriteLine(nvFileHandle, "  gamename=\"ja\"");
1252       WriteLine(nvFileHandle, "/>");
1253       CloseFile(nvFileHandle);
1254     endif;
1255     if (DO_GAME_Q2_BOOL == 1) then
1256       if (CreateDir(TARGETDIR ^ "games")< 0) then
1257          // Report the error; then abort.
1258          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1259          abort;
1260       endif;
1261       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "q2.game")< 0) then
1262         // Report the error.
1263         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\q2.game failed.", SEVERE);
1264         abort;
1265       endif;
1266       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1267       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1268       WriteLine(nvFileHandle, "<game");
1269       WriteLine(nvFileHandle, "  name=\"Quake II\"");
1270       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_Q2 + "/\"");
1271       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_Q2 + "/\"");
1272       WriteLine(nvFileHandle, "  basegame=\"baseq2\"");
1273       WriteLine(nvFileHandle, "  engine=\"quake2.exe\"");
1274       WriteLine(nvFileHandle, "  gamename=\"q2\"");
1275       WriteLine(nvFileHandle, "  no_patch=\"1\"");
1276       WriteLine(nvFileHandle, "/>");
1277       CloseFile(nvFileHandle);
1278     endif;
1279     if (DO_GAME_HER2_BOOL == 1) then
1280       if (CreateDir(TARGETDIR ^ "games")< 0) then
1281          // Report the error; then abort.
1282          MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
1283          abort;
1284       endif;
1285       if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "heretic2.game")< 0) then
1286         // Report the error.
1287         MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\heretic2.game failed.", SEVERE);
1288         abort;
1289       endif;
1290       WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
1291       WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
1292       WriteLine(nvFileHandle, "<game");
1293       WriteLine(nvFileHandle, "  name=\"Heretic II\"");
1294       WriteLine(nvFileHandle, "  enginepath =\"" + szDIR_GAME_HER2 + "/\"");
1295       WriteLine(nvFileHandle, "  gametools=\"" + szDIR_GAMETOOLS_HER2 + "/\"");
1296       WriteLine(nvFileHandle, "  basegame=\"base\"");
1297       WriteLine(nvFileHandle, "  engine=\"heretic2.exe\"");
1298       WriteLine(nvFileHandle, "  gamename=\"heretic2\"");
1299       WriteLine(nvFileHandle, "  no_patch=\"1\"");
1300       WriteLine(nvFileHandle, "/>");
1301       CloseFile(nvFileHandle);
1302     endif;
1303
1304   endif;
1305 end;
1306
1307 // --- include script file section ---