-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.rul
More file actions
685 lines (550 loc) · 25.6 KB
/
setup.rul
File metadata and controls
685 lines (550 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
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
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
////////////////////////////////////////////////////////////////////////////////
// //
// IIIIIII SSSSSS //
// II SS InstallShield (R) //
// II SSSSSS (c) 1996-1997, InstallShield Software Corporation //
// II SS (c) 1990-1996, InstallShield Corporation //
// IIIIIII SSSSSS All Rights Reserved. //
// //
// //
// This code is generated as a starting installation template. You should //
// modify it to provide all necessary steps for your installation. //
// //
// //
// File Name: setup.rul //
// //
// Description: InstallShield Script //
// //
// Comments: This template script performs a basic installation to a //
// Windows 95 or Windows NT platform. With minor modifications,//
// this template can be adapted to create new, customized //
// installations. //
// //
// //
////////////////////////////////////////////////////////////////////////////////
// Include header file
#include "sddialog.h"
#include "winsub.h"
//////////////////// string defines ///////////////////
#define UNINST_LOGFILE_NAME "Uninst.isu"
//////////////////// installation declarations ///////////////////
// ----- DLL prototypes -----
// generated
// your DLL prototypes
// ---- script prototypes -----
// generated
prototype ShowDialogs();
prototype MoveFileData();
prototype HandleMoveDataError( NUMBER );
prototype ProcessBeforeDataMove();
prototype ProcessAfterDataMove();
prototype SetupRegistry();
prototype SetupFolders();
prototype CleanUpInstall();
prototype SetupInstall();
prototype SetupScreen();
prototype CheckRequirements();
prototype DialogShowSdAskDestPath();
prototype DialogShowSdSelectFolder();
prototype DialogShowSdStartCopy();
prototype DialogShowSdFinishReboot();
// your prototypes
prototype CreMyFolder();
// ----- global variables ------
// generated
BOOL bWinNT, bIsShellExplorer;
STRING svDir;
STRING svName, svCompany, svSerial;
STRING svDefGroup;
STRING szAppPath;
STRING svSetupType;
LIST listStartCopy;
// your global variables
///////////////////////////////////////////////////////////////////////////////
// //
// MAIN PROGRAM //
// //
// The installation begins here by staring out by hiding the visible //
// installation window. This is done to allow all the titles, images //
// etc.. to be setup before showing the main window. The following //
// logic then performs the installation in a series of steps. //
// //
///////////////////////////////////////////////////////////////////////////////
program
Disable( BACKGROUND );
SetupInstall();
SetupScreen();
if (ShowDialogs()<0) goto end_install;
if (ProcessBeforeDataMove()<0) goto end_install;
if (MoveFileData()<0) goto end_install;
if (ProcessAfterDataMove()<0) goto end_install;
if (SetupRegistry()<0) goto end_install;
if (SetupFolders()<0) goto end_install;
if (CleanUpInstall()<0) goto end_install;
end_install:
exit;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: ShowDialogs //
// //
// Purpose: This function manages the operation of showing and navigating //
// the standard dialogs that exist in a installation. //
// //
///////////////////////////////////////////////////////////////////////////////
function ShowDialogs()
NUMBER nResult;
begin
Dlg_Start:
// beginning of dialogs label
Dlg_SdAskDestPath:
nResult = DialogShowSdAskDestPath();
if (nResult = BACK) goto Dlg_Start;
Dlg_SdSelectFolder:
nResult = DialogShowSdSelectFolder();
if (nResult = BACK) goto Dlg_SdAskDestPath;
Dlg_SdStartCopy:
nResult = DialogShowSdStartCopy();
if (nResult = BACK) goto Dlg_SdSelectFolder;
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: MoveFileData //
// //
// Purpose: This function will setup and handle the data movement for //
// the installation. //
// //
///////////////////////////////////////////////////////////////////////////////
function MoveFileData()
NUMBER nResult, nDisk;
begin
nDisk = 1;
SetStatusWindow( 0, "" );
Disable( DIALOGCACHE );
Enable( STATUS );
StatusUpdate( ON, 100 );
nResult = ComponentMoveData( MEDIA, nDisk, 0 );
HandleMoveDataError( nResult );
Disable( STATUS );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: HandleMoveDataError //
// //
// Purpose: This will handle the error (if any) during the move data //
// operation. //
// //
///////////////////////////////////////////////////////////////////////////////
function HandleMoveDataError( nResult )
begin
switch (nResult)
case 0:
return 0;
default:
SprintfBox( WARNING, @TITLE_CAPTIONBAR, @ERROR_MOVEDATA, nResult );
return nResult;
endswitch;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: ProcessAfterDataMove //
// //
// Purpose: This will perform any necessary operations needed after all //
// data has been moved. //
// //
///////////////////////////////////////////////////////////////////////////////
function ProcessAfterDataMove()
begin
// TODO : update self-registered files and other processes that
// should be perform after the data has been moved.
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: ProcessBeforeDataMove //
// //
// Purpose: This will perform any necessary operations prior to the //
// actual data move operation. //
// //
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
STRING svLogFile;
begin
// TODO : update any items you want to process before moving the data
//
InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
svLogFile = UNINST_LOGFILE_NAME;
DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
RegDBSetItem( REGDB_APPPATH, szAppPath );
RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupRegistry //
// //
// Purpose: This will setup the registry entries for this installation. //
// //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupRegistry()
STRING svTmpPath;
begin
//vsView lic
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
if( RegDBCreateKeyEx("Licenses\\C4541CC0-C4E4-11D2-8939-0000C0648DCF", "") < 0 ) then
MessageBox( "Cann't create license key 1", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "Licenses\\C4541CC0-C4E4-11D2-8939-0000C0648DCF", "",
REGDB_STRING, "", -1 );
//Sheridan
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX", "") < 0 ) then
MessageBox( "Cann't create license key 2", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "Sheridan.ActiveThreed.ActiveX", "",
REGDB_STRING, "", -1 );
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX\\Version2", "") < 0 ) then
MessageBox( "Cann't create key2", SEVERE );
//abort;
endif;
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX\\Version2\\CompanyName", "") < 0 ) then
MessageBox( "Cann't create key2", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "Sheridan.ActiveThreed.ActiveX\\Version2\\CompanyName", "",
REGDB_STRING, "AlexCorp", -1 );
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX\\Version2\\HelpFileDir", "") < 0 ) then
MessageBox( "Cann't create key2", SEVERE );
//abort;
endif;
svTmpPath = TARGETDIR ^ "Sheridan\\HELP";
LongPathToQuote( svTmpPath , TRUE );
RegDBSetKeyValueEx( "Sheridan.ActiveThreed.ActiveX\\Version2\\HelpFileDir", "",
REGDB_STRING, svTmpPath, -1 );
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX\\Version2\\InstallDir", "") < 0 ) then
MessageBox( "Cann't create key2", SEVERE );
//abort;
endif;
svTmpPath = TARGETDIR ^ "Sheridan";
LongPathToQuote( svTmpPath , TRUE );
RegDBSetKeyValueEx( "Sheridan.ActiveThreed.ActiveX\\Version2\\InstallDir", "",
REGDB_STRING, svTmpPath, -1 );
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX\\Version2\\SerialNumber", "") < 0 ) then
MessageBox( "Cann't create key2", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "Sheridan.ActiveThreed.ActiveX\\Version2\\SerialNumber", "",
REGDB_STRING, "012001A00007575363", -1 );
if( RegDBCreateKeyEx("Sheridan.ActiveThreed.ActiveX\\Version2\\UserName", "") < 0 ) then
MessageBox( "Cann't create key2", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "Sheridan.ActiveThreed.ActiveX\\Version2\\UserName", "",
REGDB_STRING, "Alex", -1 );
//GreenTree reg
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
if( RegDBCreateKeyEx("SOFTWARE\\Classes\\GreenTree_ActiveControlPak", "") < 0 ) then
MessageBox( "Cann't create key3", SEVERE );
//abort;
endif;
if( RegDBCreateKeyEx("SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1", "") < 0 ) then
MessageBox( "Cann't create key3", SEVERE );
//abort;
endif;
if( RegDBCreateKeyEx("SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\Company", "") < 0 ) then
MessageBox( "Cann't create key3", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\Company", "",
REGDB_STRING, "AlexCorp", -1 );
if( RegDBCreateKeyEx("SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\MainPath", "") < 0 ) then
MessageBox( "Cann't create key3", SEVERE );
//abort;
endif;
svTmpPath = TARGETDIR ^ "GT";
LongPathToQuote( svTmpPath , TRUE );
RegDBSetKeyValueEx( "SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\MainPath", "",
REGDB_STRING, svTmpPath, -1 );
if( RegDBCreateKeyEx("SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\Name", "") < 0 ) then
MessageBox( "Cann't create key3", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\Name", "",
REGDB_STRING, "Alex", -1 );
if( RegDBCreateKeyEx("SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\SerialNumber", "") < 0 ) then
MessageBox( "Cann't create key3", SEVERE );
//abort;
endif;
RegDBSetKeyValueEx( "SOFTWARE\\Classes\\GreenTree_ActiveControlPak\\Version_1\\SerialNumber", "",
REGDB_STRING, "621001109444", -1 );
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupFolders //
// //
// Purpose: This function will setup all the folders and shortcuts for the //
// installation. This includes program groups, items for Win31 //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupFolders()
STRING svPath, strTmp2;
NUMBER nResult;
begin
// TODO : Add all your folder (program group) along with shortcuts (program items)
//
//
// AddFolderGroup....
//
svPath = TARGETDIR ^ "EXE\\hazard.exe";
strTmp2 = TARGETDIR ^ "EXE\\";
LongPathToQuote( svPath , TRUE );
//LongPathToQuote( strTmp2, TRUE );
nResult = AddFolderIcon( "", "Hazard 2000" , svPath , strTmp2 , "" , 0 , "" , REPLACE );
if( nResult < 0 ) then
MessageBox( "Cann't insert icon in menu Start", WARNING );
endif;
if( MessageBox("Ñîçäàòü èêîíêó íà ñòîëå ?", 4|0x20) == 6 )
then
nResult = AddFolderIcon( FOLDER_DESKTOP, "Hazard 2000" , svPath , strTmp2, "" , 0 , "" , REPLACE );
if( nResult < 0 ) then
MessageBox( "Error of creating shortcut on desktop", WARNING );
endif;
endif;
if( MessageBox("Ñîçäàòü ïàïêó íà ñòîëå ?", 4|0x20) == 6 )
then
nResult = CreMyFolder();
if( nResult < 0 ) then
MessageBox( "Error creating of folder", WARNING );
endif;
endif;
return 0;
end;
function CreMyFolder()
STRING szProgram, szFolderDir, szCommandLine, szProgramFolder;
STRING szWorkingDir, szIconPath, szShortCutKey, szItemName;
NUMBER nIcon, nFlag, nResult;
begin
szItemName = "Hazard 2000";
szFolderDir = FOLDER_DESKTOP ^ svDefGroup;
nResult = CreateDir( szFolderDir );
if( nResult < 0 ) goto end_Err;
szCommandLine = TARGETDIR ^ "EXE\\hazard.exe";
LongPathToQuote( szCommandLine, TRUE );
szWorkingDir = TARGETDIR ^ "EXE\\";
szIconPath = "";
nIcon = 0;
szShortCutKey = "";
//nFlag = REPLACE|RUN_MINIMIZED;
nFlag = REPLACE;
nResult = AddFolderIcon( szFolderDir, szItemName, szCommandLine,
szWorkingDir, szIconPath, nIcon, szShortCutKey,
nFlag );
//nResult = CreateProgramFolder( szItemName );
if( nResult < 0 ) goto end_Err;
ShowProgramFolder( szFolderDir, SW_SHOW );
szProgramFolder = szFolderDir;
szItemName = "Ïðèìåð ìîäåëè";
szProgram = TARGETDIR ^ "Examples\\" ^ "default.hzd";
LongPathToQuote( szProgram, TRUE );
szCommandLine = szProgram;
szWorkingDir = "";
szIconPath = "";
nResult = AddFolderIcon( szProgramFolder, szItemName, szCommandLine,
"" , "" , 0 , "",
REPLACE );
if( nResult < 0 ) goto end_Err;
Delay( 1 );
ShowProgramFolder( szFolderDir, SW_MINIMIZE );
SetWindowPos( GetWindowHandle(HWND_INSTALL), 0, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
_WinSubFocusWindow( GetWindowHandle(HWND_INSTALL) );
return 0;
end_Err:
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: CleanUpInstall //
// //
// Purpose: This will cleanup the installation. Anything that should //
// be released or delete at the end of the installation should //
// be done here. //
// //
///////////////////////////////////////////////////////////////////////////////
function CleanUpInstall()
begin
DialogShowSdFinishReboot();
if (BATCH_INSTALL) then // ensure locked files are properly written
CommitSharedFiles(0);
endif;
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupInstall //
// //
// Purpose: This will setup the installation. Any general initialization //
// needed for the installation should be performed here. //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupInstall()
begin
Enable( CORECOMPONENTHANDLING );
listStartCopy = ListCreate(0);
svDir = PROGRAMFILES ^ @COMPANY_NAME;
TARGETDIR = svDir;
szAppPath = svDir;
SdProductName( @PRODUCT_NAME );
Enable( DIALOGCACHE );
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupScreen //
// //
// Purpose: This function will set up the screen look. This includes //
// colors, fonts, text to be displayed, etc. //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupScreen()
NUMBER nDx, nDy;
begin
GetExtents( nDx, nDy );
Enable( FULLWINDOWMODE );
SetTitle( @TITLE_MAIN, 24, WHITE );
SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
Enable( BACKGROUND );
Delay( 1 );
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: CheckRequirements //
// //
// Purpose: This function will check all minimum requirements for the //
// application being installed. If any fail, then the user //
// is informed and the installation is terminated. //
// //
///////////////////////////////////////////////////////////////////////////////
function CheckRequirements()
NUMBER nvDx, nvDy, nvResult;
STRING svResult;
begin
// Check screen resolution.
GetExtents( nvDx, nvDy );
if (nvDy < 480) then
MessageBox( @ERROR_VGARESOLUTION, WARNING );
abort;
endif;
// Determine the target system's operating system.
GetSystemInfo( OS, nvResult, svResult );
bWinNT = FALSE;
bIsShellExplorer = FALSE;
if (nvResult = IS_WINDOWSNT) then
bWinNT = TRUE; // Running Windows NT.
// Check to see if the shell being used is EXPLORER shell.
if (( nvResult = IS_WINDOWSNT ) || ( nvResult = IS_WINDOWS95 )) then
if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
if (nvResult >= 4) then
bIsShellExplorer = TRUE;
endif;
endif;
endif;
elseif (nvResult = IS_WINDOWS95 ) then
bIsShellExplorer = TRUE;
endif;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowSdAskDestPath //
// //
// Purpose: This function will handle the query of the user for the //
// destination directory. //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdAskDestPath()
NUMBER nResult;
STRING szTitle, szMsg;
begin
szTitle = "";
szMsg = "";
nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
TARGETDIR = svDir;
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowSdSelectFolder //
// //
// Purpose: This function will handle the standard folder selection dialog. //
// //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdSelectFolder()
NUMBER nResult;
STRING szTitle, szMsg;
begin
if (svDefGroup = "") then
svDefGroup = @FOLDER_NAME;
endif;
szTitle = "";
szMsg = "";
nResult = SdSelectFolder( szTitle, szMsg, svDefGroup );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowSdStartCopy //
// //
// Purpose: This function will handle the dialog preceding the start of the //
// file copying process. //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdStartCopy()
NUMBER nResult;
STRING szTitle, szMsg;
begin
listStartCopy = ListCreate( STRINGLIST );
ListAddString( listStartCopy, "Place the summary here.", TRUE );
szTitle = "";
szMsg = "";
nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowSdFinishReboot //
// //
// Purpose: This function will show the last dialog of the product. //
// It will allow the user to reboot and/or show some readme text. //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdFinishReboot()
NUMBER nResult, nDefOptions;
STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
NUMBER bOpt1, bOpt2;
begin
if (!BATCH_INSTALL) then
bOpt1 = FALSE;
bOpt2 = FALSE;
szMsg1 = "";
szMsg2 = "";
szOption1 = "";
szOption2 = "";
nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
return 0;
endif;
nDefOptions = SYS_BOOTMACHINE;
szTitle = "";
szMsg1 = "";
szMsg2 = "";
nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
return nResult;
end;
// --- include script file section ---
#include "sddialog.rul"
#include "winsub.rul"