home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------------*\
- *
- * IIIIIII SSSSSS
- * II SS InstallSHIELD (R)
- * II SSSSSS (c) 1990-1995, Stirling Technologies, Inc.
- * II SS All Rights Reserved.
- * IIIIIII SSSSSS
- *
- *
- * This source code is intended as a supplement to Stirling Technologies,
- * Inc., product documentation. Refer to your Stirling Technologies, Inc.,
- * product documentation for more detailed information.
- *
- *
- * File Name: SETUP.RUL
- *
- * Description: InstallSHIELD SDK Edition Template One script.
- *
- *
- *
- *
- * Author: Stirling Technologies, Inc. Date: 2-4-95
- *
- * Comments: This template script performs a basic installation to a
- * Windows 95 or Windows NT platform. The installation
- * includes components: Application Program Files, Sample and
- * Template Files, Online Help Files, and Multimedia Tutorial
- * Files. With minor modifications, this template can be
- * adapted to create new, customized installations.
- *
- * There maybe small differences between this script and the
- * script shown in the on-line User's Guide
- *
- *
- \*----------------------------------------------------------------------------*/
-
-
-
- // Size of components.
- //#define SIZE_REQ_SAMPLES 82000
- //#define SIZE_REQ_TEMPLATES 2000
- #define SIZE_REQ_PROGRAM 3753707
-
- #define APP_NAME "Reality Lab"
- #define PROGRAM_GROUP_NAME "Reality Lab"
- #define APPBASE_PATH "RM\\RealityLab\\"
- #define COMPANY_NAME "Microsoft Rendermorphics"
- #define PRODUCT_NAME "Reality Lab"
- #define PRODUCT_VERSION "2.0 Beta 11"
- #define PRODUCT_KEY ""
- #define UNINSTALL_KEY "RealityLabV2B11"
- #define APPBASE_DIR95 ""
- #define BASE_REGISTRYNT "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\"
- #define BASE_REGISTRY95 "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
-
- #define STR_COMPLETE95 "by selecting the program icon in the Programs menu.\n\n"
- #define STR_COMPLETENT "by selecting the program icon in the program group.\n\n"
-
- declare
-
- // Global variable declarations.
- STRING svGrp, szMsg, szFileSet, szTitle, szAppPath, szAppSharedDir;
- STRING szProgram, szTemp, svUninstLogFile, szRegKey;
- STRING svMainDirectory[ _MAX_STRING ];
- STRING svWinSystem, svWinPath;
- BOOL bSpaceOk, bReshowSetupType;
- NUMBER nResult, nStatusId, nType;
-
- BOOL bIncludeProgram, bIncludeSamples, bIncludeHelp;
- BOOL bWinNT;
-
- // Function declarations.
- prototype SetupScreen();
- prototype CheckRequirements();
- prototype CheckSpaceRequirements( string );
- prototype CreateRegDBEntries();
-
- program
-
- StartHere:
- Disable( BACKGROUND );
-
- // Set up the installation screen.
- SetupScreen();
-
- // Set installation info., which is required for registry entries.
- InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
-
- // Create a Welcome dialog.
- WelcomeDlg:
- Disable( BACKBUTTON );
- Welcome( "Welcome", 0 );
- Enable( BACKBUTTON );
-
- // Test target system proper configuration.
- CheckRequirements();
-
- // Ask user for a destination location for the installation.
- GetTargetDirectory:
-
- svMainDirectory = TARGETDISK ^ APPBASE_DIR95 ^ APPBASE_PATH;
-
- szMsg = "";
- if ( AskDestPath( "Choose Destination Location", szMsg,
- svMainDirectory, 0 ) = BACK ) then
- goto WelcomeDlg;
- endif;
-
- szAppSharedDir = svMainDirectory ^ "System";
-
- GetEnvVar("WINDIR",svWinPath);
- if ( ExistsDir(svWinPath + "\\system")) then svWinSystem = svWinPath + "\\system"; endif;
- MessageBox(svWinSystem , INFORMATION );
-
- nType = TYPICAL;
-
- FileTransferSetup:
-
- // Prepare InstallSHIELD to record deinstallation information.
- bSpaceOk = CheckSpaceRequirements( svMainDirectory );
-
- DeinstallStart( svMainDirectory, svUninstLogFile, UNINSTALL_KEY, 0 );
- RegDBSetItem( REGDB_UNINSTALL_NAME, APP_NAME );
-
- // Set registry App Paths key information for the main application.
- szAppPath = svMainDirectory ^ "PROGRAM" + ";" + szAppSharedDir;
- RegDBSetItem( REGDB_APPPATH, szAppPath );
- szProgram = svMainDirectory ^ "PROGRAM\\designer.exe";
- RegDBSetItem( REGDB_APPPATH_DEFAULT, szProgram );
-
- // Define the "General" file set.
- szFileSet = "General";
-
- FileSetBeginDefine( szFileSet );
-
- SetStatusWindow( -1, "Copying program files..." );
-
- // Always copy README & related files, located at
- // the root level in the DATA.Z library file.
- //TARGETDIR = svMainDirectory;
- //CompressGet( "data.z", "*.*", INCLUDE_SUBDIR );
-
- TARGETDIR = svWinSystem;
- CompressGet( "dll.z", "*.*", INCLUDE_SUBDIR );
-
- FileSetEndDefine( szFileSet );
-
- DoFileTransfer:
- // Set up progress indicator and information gauge.
- Enable( STATUSDLG );
- StatusUpdate( ON, 90 );
-
- // Perform the file set.
- nResult = FileSetPerformEz( szFileSet, 0 );
-
- switch (nResult)
-
- case FS_DONE: // Successful completion.
-
- case FS_CREATEDIR: // Create directory error.
- MessageBox( "Unable to create a directory under " + TARGETDIR + "."+
- "Please check write access to this directory.", SEVERE );
- abort;
-
- default: // Group all other errors under default label.
- NumToStr( szTemp, nResult );
- MessageBox( "General file transfer error."+
- "Please check your target location and try again."+
- "\n\n Error Number:"+szTemp, SEVERE );
-
- abort;
- endswitch;
-
- SetRegistryEntries:
-
- CreateRegDBEntries( );
-
- Delay(2);
- Disable( FEEDBACK_FULL );
- Disable( STATUSDLG );
-
- // Create program groups (folders) and icons.
-
-
- // Announce setup complete and offer to read README file.
-
- SetStatusWindow( 100, "Installation complete." );
-
- MessageBox( szMsg, INFORMATION );
-
- exit;
-
-
- /*---------------------------------------------------------------------------*\
- *
- * Function: SetupScreen
- *
- * Purpose: This function will set up the screen look. This includes
- * colors, fonts, text to be displayed, etc.
- *
- *
- * Input:
- *
- * Returns:
- *
- * Comments:
- \*---------------------------------------------------------------------------*/
-
- function SetupScreen()
- begin
-
- Enable( INDVFILESTATUS );
-
- SetTitle( APP_NAME + " Setup", 28, WHITE );
-
- SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
-
- Enable( BACKGROUND );
-
- 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.
- *
- *
- * Input:
- *
- * Returns:
- *
- * Comments:
- \*---------------------------------------------------------------------------*/
-
- function CheckRequirements()
- number nvDx, nvDy;
- number nvResult;
- STRING szResult;
- begin
-
- // Determine if target system uses NT or Windows 95.
- GetSystemInfo( WINMAJOR, nvResult, szResult );
- bWinNT = TRUE;
- if (nvResult = 4) then
- bWinNT = FALSE; // Running Windows 95.
- endif;
-
- // Check screen resolution.
- GetExtents( nvDx, nvDy );
- if (nvDy < 480) then
- MessageBox( "This program requires VGA or better resolution.", WARNING );
- exit;
- endif;
-
- end;
-
- /*---------------------------------------------------------------------------*\
- *
- * Function: CheckSpaceRequirements
- *
- * Purpose: This function will check space requirements based on the
- * elements being installed.
- *
- * Input:
- *
- * Returns:
- *
- * Comments:
- \*---------------------------------------------------------------------------*/
-
- function CheckSpaceRequirements( szDir )
- number nSizeRequired;
- begin
-
- nSizeRequired = 0;
-
- nSizeRequired = SIZE_REQ_PROGRAM;
-
- // Check space on target drive.
- bSpaceOk = TRUE;
- if (GetDiskSpace( szDir ) < nSizeRequired) then
- szMsg = "There is not enough space available on the disk\n" +
- "'" + svMainDirectory + "' \n" +
- "Please free up some space or change the target location\n" +
- "to a different disk";
- MessageBeep(0);
- MessageBox( szMsg, WARNING );
- bSpaceOk = FALSE;
- endif;
-
- return bSpaceOk;
- end;
-
-
- /*---------------------------------------------------------------------------*\
- *
- * Function: CreateRegDBEntries
- *
- * Purpose: This function will create necessary keys and values for
- * the sample program.
- *
- * Input:
- *
- * Returns:
- *
- * Comments:
- \*---------------------------------------------------------------------------*/
-
- function CreateRegDBEntries()
- string szKey[255], szValue, szDemo, szProgram;
- begin
-
- RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
-
- // Create PRODUCT_KEY key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "DESIGNER";
- RegDBCreateKeyEx( szKey, "" );
-
- RegDBSetKeyValueEx( szKey, "Template", REGDB_STRING, "good.tpl", -1 );
- RegDBSetKeyValueEx( szKey, "TemplatePath", REGDB_STRING, svMainDirectory ^ "TEMPLATE", -1 );
- RegDBSetKeyValueEx( szKey, "x", REGDB_NUMBER, "2", -1 );
- RegDBSetKeyValueEx( szKey, "y", REGDB_NUMBER, "3", -1 );
- RegDBSetKeyValueEx( szKey, "dx", REGDB_NUMBER, "637", -1 );
- RegDBSetKeyValueEx( szKey, "dy", REGDB_NUMBER, "448", -1 );
- RegDBSetKeyValueEx( szKey, "LargeDraw", REGDB_NUMBER, "1", -1 );
- RegDBSetKeyValueEx( szKey, "PopupMenu", REGDB_NUMBER, "1", -1 );
- RegDBSetKeyValueEx( szKey, "NoPopup", REGDB_NUMBER, "1", -1 );
- RegDBSetKeyValueEx( szKey, "StartDialogValue", REGDB_NUMBER, "111", -1 );
- RegDBSetKeyValueEx( szKey, "TimeVisible", REGDB_NUMBER, "0", -1 );
-
- if (bIncludeSamples) then
- // Create "DEMOS" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "DEMOS";
- RegDBCreateKeyEx( szKey, "" );
-
- szDemo = svMainDirectory ^ "SAMPLES\\TECH.DBD";
- szProgram = svMainDirectory ^ "PROGRAM\\DEMO.EXE";
- RegDBSetKeyValueEx( szKey, "path0", REGDB_STRING, szDemo, -1 );
-
- szDemo = svMainDirectory ^ "SAMPLES\\2MINUTE.DBD";
- RegDBSetKeyValueEx( szKey, "path1", REGDB_STRING, szDemo, -1 );
- RegDBSetKeyValueEx( szKey, "tour", REGDB_STRING, szDemo, -1 );
-
- RegDBSetKeyValueEx( szKey, "exe", REGDB_STRING, szProgram, -1 );
- RegDBSetKeyValueEx( szKey, "active", REGDB_STRING, "Play", -1 );
-
- endif;
-
- // Create "HELPMENU" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "HELPMENU";
- RegDBCreateKeyEx( szKey, "" );
-
- RegDBSetKeyValueEx( szKey, "MaxNum", REGDB_NUMBER, "1", -1 );
-
- RegDBSetKeyValueEx( szKey, "path0", REGDB_STRING, svMainDirectory ^ "README.TXT", -1 );
- RegDBSetKeyValueEx( szKey, "exe0", REGDB_STRING, "NOTEPAD.EXE", -1 );
- RegDBSetKeyValueEx( szKey, "active0", REGDB_STRING, "Read Me", -1 );
-
- // Create "MRU" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "MRU";
- RegDBCreateKeyEx( szKey, "" );
-
- szDemo = svMainDirectory ^ "SAMPLES\\2MINUTE.DBD";
- RegDBSetKeyValueEx( szKey, "path0", REGDB_STRING, szDemo, -1 );
-
- // Create "SceneEditor" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "SceneEditor";
- RegDBCreateKeyEx( szKey, "" );
-
- RegDBSetKeyValueEx( szKey, "x", REGDB_NUMBER, "453", -1 );
- RegDBSetKeyValueEx( szKey, "y", REGDB_NUMBER, "2", -1 );
- RegDBSetKeyValueEx( szKey, "Visible", REGDB_NUMBER, "1", -1 );
-
- // Create "ToolPalette" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "ToolPalette";
- RegDBCreateKeyEx( szKey, "" );
-
- RegDBSetKeyValueEx( szKey, "x", REGDB_NUMBER, "509", -1 );
- RegDBSetKeyValueEx( szKey, "y", REGDB_NUMBER, "155", -1 );
- RegDBSetKeyValueEx( szKey, "Visible", REGDB_NUMBER, "1", -1 );
-
- // Create "AlignPalette" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "AlignPalette";
- RegDBCreateKeyEx( szKey, "" );
-
- RegDBSetKeyValueEx( szKey, "Visible", REGDB_NUMBER, "0", -1 );
-
- // Create "Controller" key.
- szKey = "SOFTWARE\\" + COMPANY_NAME + "\\" + PRODUCT_NAME + "\\" +
- PRODUCT_VERSION + "\\" + "Controller";
- RegDBCreateKeyEx( szKey, "" );
-
- RegDBSetKeyValueEx( szKey, "x", REGDB_NUMBER, "420", -1 );
- RegDBSetKeyValueEx( szKey, "y", REGDB_NUMBER, "231", -1 );
- RegDBSetKeyValueEx( szKey, "Visible", REGDB_NUMBER, "1", -1 );
-
- end;
-
-