source: trunk/is_gsdl_cdrom/Script Files/setup.rul@ 2822

Last change on this file since 2822 was 2822, checked in by sjboddie, 22 years ago

Initial revision

  • Property svn:keywords set to Author Date Id Revision
File size: 16.0 KB
Line 
1
2////////////////////////////////////////////////////////////////////////////////
3//
4// IIIIIII SSSSSS
5// II SS InstallShield (R)
6// II SSSSSS (c) 1996-1997, 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 "sdlang.h"
29 #include "sddialog.h"
30
31////////////////////// string defines ////////////////////////////
32
33 #define UNINST_LOGFILE_NAME "Uninst.isu"
34
35//////////////////// installation declarations ///////////////////
36
37// ----- DLL function prototypes -----
38
39
40 // your DLL function prototypes
41
42
43// ---- script function prototypes -----
44
45 // generated by the Project Wizard
46 prototype ShowDialogs();
47 prototype MoveFileData();
48 prototype HandleMoveDataError( NUMBER );
49 prototype ProcessBeforeDataMove();
50 prototype ProcessAfterDataMove();
51 prototype SetupRegistry();
52 prototype SetupFolders();
53 prototype CleanUpInstall();
54 prototype SetupInstall();
55 prototype SetupScreen();
56 prototype CheckRequirements();
57 prototype DialogShowSdLicense();
58 prototype DialogShowSdFinishReboot();
59
60 // your script function prototypes
61 prototype DialogGreenstoneInstallationType();
62 prototype DialogSetupType();
63 prototype DialogSelectCollections();
64 prototype DialogSetAdminPassword();
65 prototype SetComponents();
66
67 // ----- global variables ------
68
69 // generated by the Project Wizard
70 BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
71 STRING svDir;
72 STRING svName, svCompany, svSerial;
73 STRING svDefGroup;
74 STRING szAppPath;
75 STRING svSetupType;
76
77
78 // your global variables
79 BOOL bWin31, bCompact;
80
81///////////////////////////////////////////////////////////////////////////////
82//
83// MAIN PROGRAM
84//
85// The setup begins here by hiding the visible setup
86// window. This is done to allow all the titles, images, etc. to
87// be established before showing the main window. The setup is
88// then performed in a series of calls to script defined functions,
89// with error checking at each step.
90//
91///////////////////////////////////////////////////////////////////////////////
92program
93 Disable( BACKGROUND );
94
95 CheckRequirements();
96
97 SetupInstall();
98
99 SetupScreen();
100
101 if (ShowDialogs()<0) goto end_install;
102
103 if (ProcessBeforeDataMove()<0) goto end_install;
104
105 if (MoveFileData()<0) goto end_install;
106
107 if (ProcessAfterDataMove()<0) goto end_install;
108
109 if (SetupRegistry()<0) goto end_install;
110
111 if (SetupFolders()<0) goto end_install;
112
113
114 end_install:
115
116 CleanUpInstall();
117
118 // If an unrecoverable error occurred, clean up
119 // the partial installation. Otherwise, exit normally.
120
121 if (bInstallAborted) then
122 abort;
123 endif;
124
125endprogram
126
127///////////////////////////////////////////////////////////////////////////////
128//
129// Function: ShowDialogs
130//
131// Purpose: This function manages the display and navigation of
132// the standard dialogs that exist in a setup.
133//
134///////////////////////////////////////////////////////////////////////////////
135function ShowDialogs()
136 NUMBER nResult;
137
138begin
139
140 Dlg_Start:
141 // beginning of dialogs label
142
143 Dlg_SdLicense:
144 nResult = DialogShowSdLicense();
145 if (nResult = BACK) goto Dlg_Start;
146
147 if (bWin31 = FALSE) then
148
149 Dlg_GreenstoneInstallationType:
150 nResult = DialogGreenstoneInstallationType();
151 if (nResult = BACK) goto Dlg_SdLicense;
152
153 Dlg_SetupType:
154 nResult = DialogSetupType();
155 if (nResult = BACK) goto Dlg_GreenstoneInstallationType;
156
157 endif;
158
159 SetComponents();
160
161 Dlg_SelectCollections:
162 nResult = DialogSelectCollections();
163 if (nResult = BACK) then
164 if (bWin31 = TRUE) goto Dlg_SdLicense;
165 goto Dlg_SetupType;
166 endif;
167
168 Dlg_SetAdminPassWord:
169 nResult = DialogSetAdminPassword();
170 if (nResult = BACK) goto Dlg_SelectCollections;
171
172 return 0;
173
174end;
175
176///////////////////////////////////////////////////////////////////////////////
177//
178// Function: ProcessBeforeDataMove
179//
180// Purpose: This function performs any necessary operations prior to the
181// actual file transfer.
182//
183///////////////////////////////////////////////////////////////////////////////
184function ProcessBeforeDataMove()
185 STRING svLogFile;
186 NUMBER nResult;
187
188begin
189
190 // Create app information, uninstallation, and App Paths registry keys.
191
192 InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
193
194 svLogFile = UNINST_LOGFILE_NAME;
195
196 nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
197 if (nResult < 0) then
198 MessageBox( @ERROR_UNINSTSETUP, WARNING );
199 endif;
200
201 szAppPath = TARGETDIR; // TO DO : if your application .exe is in a subfolder
202 // of TARGETDIR then add subfolder
203
204 if ((bIs32BitSetup) && (bIsShellExplorer)) then
205 RegDBSetItem( REGDB_APPPATH, szAppPath );
206 RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
207 RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
208 endif;
209
210 // TO DO : any other tasks you want to perform before file transfer
211
212 return 0;
213end;
214
215///////////////////////////////////////////////////////////////////////////////
216//
217// Function: MoveFileData
218//
219// Purpose: This function handles the file transfer for
220// the setup.
221//
222///////////////////////////////////////////////////////////////////////////////
223function MoveFileData()
224 NUMBER nResult, nDisk;
225
226begin
227
228 nDisk = 1;
229 SetStatusWindow( 0, "" );
230 Disable( DIALOGCACHE );
231 Enable( STATUS );
232 StatusUpdate( ON, 100 );
233 nResult = ComponentMoveData( MEDIA, nDisk, 0 );
234
235 HandleMoveDataError( nResult );
236
237 Disable( STATUS );
238
239 return nResult;
240
241end;
242
243
244///////////////////////////////////////////////////////////////////////////////
245//
246// Function: HandleMoveDataError
247//
248// Purpose: This function handles the error (if any) during the file transfer
249// operation.
250//
251///////////////////////////////////////////////////////////////////////////////
252function HandleMoveDataError( nResult )
253 STRING szErrMsg, svComponent , svFileGroup , svFile;
254
255begin
256
257 svComponent = "";
258 svFileGroup = "";
259 svFile = "";
260
261 switch (nResult)
262 case 0:
263 return 0;
264 default:
265 ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
266 szErrMsg = @ERROR_MOVEDATA + "\n\n" +
267 @ERROR_COMPONENT + " " + svComponent + "\n" +
268 @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
269 @ERROR_FILE + " " + svFile;
270 SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
271 bInstallAborted = TRUE;
272 return nResult;
273 endswitch;
274
275end;
276
277///////////////////////////////////////////////////////////////////////////////
278//
279// Function: ProcessAfterDataMove
280//
281// Purpose: This function performs any necessary operations needed after
282// all files have been transferred.
283//
284///////////////////////////////////////////////////////////////////////////////
285function ProcessAfterDataMove()
286 STRING szReferenceFile;
287
288begin
289
290 // TO DO : update self-registered files and other processes that
291 // should be performed after the files have been transferred.
292
293 // DeinstallSetReference specifies a file to be checked before
294 // uninstallation. If the file is in use, uninstallation will not proceed.
295
296 szReferenceFile = svDir ^ @PRODUCT_KEY; // TO DO : If your file is in a
297 // subfolder of svDir add that here
298 DeinstallSetReference( szReferenceFile );
299
300 return 0;
301end;
302
303///////////////////////////////////////////////////////////////////////////////
304//
305// Function: SetupRegistry
306//
307// Purpose: This function makes the registry entries for this setup.
308//
309///////////////////////////////////////////////////////////////////////////////
310function SetupRegistry()
311 NUMBER nResult;
312
313begin
314
315 // TO DO : Add all your registry entry keys here.
316 // Call registry functions and/or create keys from
317 // the InstallShield IDE's Resources pane.
318
319 nResult = CreateRegistrySet( "" );
320
321 return nResult;
322 end;
323
324///////////////////////////////////////////////////////////////////////////////
325//
326// Function: SetupFolders
327//
328// Purpose: This function creates all the folders and shortcuts for the
329// setup. This includes program groups and items for Windows 3.1.
330//
331///////////////////////////////////////////////////////////////////////////////
332function SetupFolders()
333 NUMBER nResult;
334
335begin
336
337
338 // TO DO : Add all your folders (or program groups) along with shortcuts (or
339 // program items). Call CreateProgramFolder and AddFolderIcon, and/or create
340 // shortcuts etc. from the InstallShield IDE's Resources pane.
341 //
342 // Note : for 16-bit setups you should add an uninstaller icon pointing to
343 // your log file. Under 32-bit this is automatically done by Windows.
344
345 nResult = CreateShellObjects( "" );
346
347 return nResult;
348 end;
349
350///////////////////////////////////////////////////////////////////////////////
351//
352// Function: CleanUpInstall
353//
354// Purpose: This cleans up the setup. Anything that should
355// be released or deleted at the end of the setup should
356// be done here.
357//
358///////////////////////////////////////////////////////////////////////////////
359function CleanUpInstall()
360
361begin
362
363
364 if (bInstallAborted) then
365 return 0;
366 endif;
367
368 DialogShowSdFinishReboot();
369
370 if (BATCH_INSTALL) then // ensure locked files are properly transferred
371 CommitSharedFiles(0);
372 endif;
373
374 return 0;
375end;
376
377///////////////////////////////////////////////////////////////////////////////
378//
379// Function: SetupInstall
380//
381// Purpose: This will initialize the setup. Any general initialization
382// needed for the installation should be performed here.
383//
384///////////////////////////////////////////////////////////////////////////////
385function SetupInstall()
386
387begin
388
389 Enable( CORECOMPONENTHANDLING );
390
391 bInstallAborted = FALSE;
392
393 // Create list of end user selections to be displayed by DialogShowSdStartCopy() //
394
395 if (bIs32BitSetup) then
396 svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
397 else
398 svDir = PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use short names
399 endif;
400
401 TARGETDIR = svDir;
402
403 SdProductName( @PRODUCT_NAME );
404
405 Enable( DIALOGCACHE );
406
407 return 0;
408end;
409
410///////////////////////////////////////////////////////////////////////////////
411//
412// Function: SetupScreen
413//
414// Purpose: This function establishes the screen look. This includes
415// colors, fonts, and text to be displayed.
416//
417///////////////////////////////////////////////////////////////////////////////
418function SetupScreen()
419
420begin
421
422 Enable( FULLWINDOWMODE );
423 Enable( INDVFILESTATUS );
424 SetTitle( @TITLE_MAIN, 24, WHITE );
425
426 SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
427
428 Enable( BACKGROUND );
429
430 Delay( 1 );
431end;
432
433///////////////////////////////////////////////////////////////////////////////
434//
435// Function: CheckRequirements
436//
437// Purpose: This function checks all minimum requirements for the
438// application being installed. If any fail, then the user
439// is informed and the setup is terminated.
440//
441///////////////////////////////////////////////////////////////////////////////
442function CheckRequirements()
443 NUMBER nvDx, nvDy, nvResult;
444 STRING svResult;
445
446begin
447
448 bWinNT = FALSE;
449 bWin31 = FALSE;
450 bIsShellExplorer = FALSE;
451
452 // Check screen resolution.
453 GetExtents( nvDx, nvDy );
454
455 if (nvDy < 480) then
456 MessageBox( @ERROR_VGARESOLUTION, WARNING );
457 abort;
458 endif;
459
460 // set 'setup' operation mode
461 bIs32BitSetup = TRUE;
462 GetSystemInfo( ISTYPE, nvResult, svResult );
463 if (nvResult = 16) then
464 bIs32BitSetup = FALSE; // running 16-bit setup
465 return 0; // no additional information required
466 endif;
467
468 // --- 32-bit testing after this point ---
469
470 // Determine the target system's operating system.
471 GetSystemInfo( OS, nvResult, svResult );
472
473 if (nvResult = IS_WINDOWSNT) then
474 // Running Windows NT.
475 bWinNT = TRUE;
476
477 // Check to see if the shell being used is EXPLORER shell.
478 if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
479 if (nvResult >= 4) then
480 bIsShellExplorer = TRUE;
481 endif;
482 endif;
483
484 elseif (nvResult = IS_WINDOWS95) then
485 bIsShellExplorer = TRUE;
486
487 elseif (nvResult = IS_WINDOWS) then
488 // Running Windows 3.1
489 bWin31 = TRUE;
490
491 endif;
492
493end;
494
495
496///////////////////////////////////////////////////////////////////////////////
497//
498// Function: DialogShowSdLicense
499//
500// Purpose: This function displays the license agreement dialog.
501//
502//
503///////////////////////////////////////////////////////////////////////////////
504function DialogShowSdLicense()
505 NUMBER nResult;
506 STRING szTitle, szMsg, szQuestion, szLicenseFile;
507
508begin
509
510 szLicenseFile = SUPPORTDIR ^ "license.txt";
511 szTitle = "";
512 szMsg = "";
513 szQuestion = "";
514 nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
515
516 return nResult;
517end;
518
519
520///////////////////////////////////////////////////////////////////////////////
521//
522// Function: DialogShowSdFinishReboot
523//
524// Purpose: This function will show the last dialog of the product.
525// It will allow the user to reboot and/or show some readme text.
526//
527///////////////////////////////////////////////////////////////////////////////
528function DialogShowSdFinishReboot()
529 NUMBER nResult, nDefOptions;
530 STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
531 NUMBER bOpt1, bOpt2;
532
533begin
534
535 if (!BATCH_INSTALL) then
536 bOpt1 = FALSE;
537 bOpt2 = FALSE;
538 szMsg1 = "";
539 szMsg2 = "";
540 szOption1 = "";
541 szOption2 = "";
542 nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
543 return 0;
544 endif;
545
546 nDefOptions = SYS_BOOTMACHINE;
547 szTitle = "";
548 szMsg1 = "";
549 szMsg2 = "";
550 nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
551
552 return nResult;
553end;
554
555///////////////////////////////////////////////////////////////////////////////
556//
557//
558//
559///////////////////////////////////////////////////////////////////////////////
560
561
562function DialogGreenstoneInstallationType()
563 NUMBER nResult;
564 STRING szTitle, szMsg;
565
566begin
567
568 szTitle = @TEXT_INSTALL_TYPE;
569 szMsg = @TEXT_INSTALL_TYPE_DESC;
570
571 nResult = SdSetupTypeEx(szTitle, szMsg, "", svSetupType, 0);
572
573 return nResult;
574end;
575
576
577function DialogSetupType()
578 NUMBER nResult, nvCheck1, nvCheck2;
579 STRING szMsg, szText1, szText2;
580
581begin
582
583 nvCheck1 = TRUE;
584 nvCheck2 = FALSE;
585 szMsg = @TEXT_SETUP_TYPE_DESC;
586 szText1 = @TEXT_COMPACT;
587 szText2 = @TEXT_FULL;
588
589 nResult = AskOptions(EXCLUSIVE, szMsg, szText1, nvCheck1, szText2, nvCheck2);
590
591 bCompact = nvCheck1;
592
593 return nResult;
594end;
595
596
597function DialogSelectCollections()
598
599 NUMBER nResult;
600
601begin
602
603 //nResult = SdComponentDialog
604
605
606 return nResult;
607end;
608
609
610function DialogSetAdminPassword()
611
612 NUMBER nResult;
613
614begin
615
616 //nResult = SdShowDlgEdit1
617
618 return nResult;
619end;
620
621
622function SetComponents()
623
624begin
625
626end;
627
628
629///////////////////////////////////////////////////////////////////////////////
630//
631//
632//
633///////////////////////////////////////////////////////////////////////////////
634
635// --- include script file section ---
636
637#include "sddialog.rul"
638
639
Note: See TracBrowser for help on using the repository browser.