//////////////////////////////////////////////////////////////////////////////// // // IIIIIII SSSSSS // II SS InstallShield (R) // II SSSSSS (c) 1996-1998, InstallShield Software Corporation // II SS (c) 1990-1996, InstallShield Corporation // IIIIIII SSSSSS All Rights Reserved. // // // This code is generated as a starting setup template. You should // modify it to provide all necessary steps for your setup. // // // File Name: Setup.rul // // Description: InstallShield script // // Comments: This template script performs a basic setup. With minor // modifications, this template can be adapted to create // new, customized setups. // //////////////////////////////////////////////////////////////////////////////// // Include header files #include "sdlang.h" #include "sddialog.h" ////////////////////// string defines //////////////////////////// #define UNINST_LOGFILE_NAME "Uninst2150.isu" #define DEF_FOLDER "SSI\\Earth 2150" #define BMP_PATH1 SUPPORTDIR + "bbrd1.bmp" #define BMP_PATH2 SUPPORTDIR + "bbrd2.bmp" #define BMP_PATH3 SUPPORTDIR + "bbrd3.bmp" #define BMP_PATH4 SUPPORTDIR + "bbrd4.bmp" #define BMP_PATH5 SUPPORTDIR + "bbrd5.bmp" //////////////////// installation declarations /////////////////// // ----- DLL function prototypes ----- // your DLL function prototypes // ---- script function prototypes ----- // generated by the Project Wizard prototype ShowDialogs(); prototype MoveFileData(); prototype HandleMoveDataError( NUMBER ); prototype ProcessBeforeDataMove(); prototype ProcessAfterDataMove(); prototype SetupRegistry(); prototype SetupFolders(); prototype CleanUpInstall(); prototype SetupInstall(); prototype SetupScreen(); prototype CheckRequirements(); prototype DialogShowSdWelcome(); prototype DialogShowSdLicense(); prototype DialogShowSdAskDestPath(); prototype DialogShowSdSelectFolder(); prototype DialogShowSdFinishReboot(); // your script function prototypes prototype DialogShowSdSetupTypeEx(); prototype RunEReg(); prototype DialogShowAskOptions(); prototype FindCD(); prototype MediaPlayerHandler(); // ----- global variables ------ // generated by the Project Wizard BOOL bIsWindowsNT4, bIsWindowsNT351, bIsWindows98, bIsWindows95, bIsShellExplorer, bInstallAborted, bIs32BitSetup; STRING svDir, svName, svCompany, svSerial, svDefGroup, svDefGroup2, szAppPath, svSetupType; // your global variables STRING svOwner, svSetupType2, svDir2, svCD1, svCD2; BOOL bDx, bIsVideo, bIsMusic, bvCheck2, bvCheck1, bvCheck3, bvCheck4, bvCheck5, bvCheck6, bMinimum, bMaximum, bNormal, bSpawnNormal, bSpawnMinimum, bvCheck7; NUMBER nDriveSpaceMB; /////////////////////////////////////////////////////////////////////////////// // // MAIN PROGRAM // // The setup begins here by hiding the visible setup // window. This is done to allow all the titles, images, etc. to // be established before showing the main window. The setup is // then performed in a series of calls to script defined functions, // with error checking at each step. // /////////////////////////////////////////////////////////////////////////////// program Disable( BACKGROUND ); CheckRequirements(); 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; RunEReg(); end_install: CleanUpInstall(); // If an unrecoverable error occurred, clean up // the partial installation. Otherwise, exit normally. if (bInstallAborted) then abort; endif; endprogram /////////////////////////////////////////////////////////////////////////////// // // Function: ShowDialogs // // Purpose: This function manages the display and navigation of // the standard dialogs that exist in a setup. // /////////////////////////////////////////////////////////////////////////////// function ShowDialogs() NUMBER nResult; begin Dlg_Start: // beginning of dialogs label Dlg_SdWelcome: nResult = DialogShowSdWelcome(); if (nResult = BACK) goto Dlg_Start; Dlg_SdLicense: nResult = DialogShowSdLicense(); if (nResult = BACK) goto Dlg_SdWelcome; Dlg_SdSetupTypeEx: nResult = DialogShowSdSetupTypeEx(); if (nResult = BACK) goto Dlg_SdLicense; Dlg_SdAskDestPath: nResult = DialogShowSdAskDestPath(); if (nResult = BACK) goto Dlg_SdSetupTypeEx; Dlg_SdSelectFolder: nResult = DialogShowSdSelectFolder(); if (nResult = BACK) goto Dlg_SdAskDestPath; Dlg_AskOptions: nResult = DialogShowAskOptions(); if (nResult = BACK) goto Dlg_SdSelectFolder; return 0; end; /////////////////////////////////////////////////////////////////////////////// // // Function: ProcessBeforeDataMove // // Purpose: This function performs any necessary operations prior to the // actual file transfer. // /////////////////////////////////////////////////////////////////////////////// function ProcessBeforeDataMove() STRING svLogFile, szProgram; NUMBER nResult; begin // Create app information, uninstallation, and App Paths registry keys. InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); svLogFile = UNINST_LOGFILE_NAME; nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); szProgram = UNINST + " -f" + "\"" + svLogFile + "\""; AddFolderIcon (svDefGroup2, "Uninstall", szProgram, WINDIR, "", 0, "", REPLACE); if (nResult < 0) then MessageBox( @ERROR_UNINSTSETUP, WARNING ); endif; szAppPath = TARGETDIR; // TO DO : if your application .exe is in a subfolder // of TARGETDIR then add subfolder if ((bIs32BitSetup) && (bIsShellExplorer)) then RegDBSetItem( REGDB_APPPATH, szAppPath ); RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); endif; // TO DO : any other tasks you want to perform before file transfer // // If you are installing self-registering files using the // batch method, remove the slashes from the line below: // // Enable ( SELFREGISTERBATCH ); return 0; end; /////////////////////////////////////////////////////////////////////////////// // // Function: MoveFileData // // Purpose: This function handles the file transfer for // the setup. // /////////////////////////////////////////////////////////////////////////////// function MoveFileData() NUMBER nResult, nDisk, nvResult, nDrawOp, nDx, nDy, nID_BITMAP; STRING svResult, svString, szName; begin bIsMusic = FALSE; bIsVideo = FALSE; bMinimum = FALSE; bNormal = FALSE; bMaximum = FALSE; bSpawnNormal = FALSE; bSpawnMinimum = FALSE; switch (svSetupType) case "1. Minimum Install": CopyFile("earth2150.exe", "Earth2150.exe"); bMinimum = TRUE; case "3. Maximum Install": CopyFile("earth2150.exe", "Earth2150.exe"); bMaximum = TRUE; case "5. Spawn Normal Install": bSpawnNormal = TRUE; case "4. Spawn Minimum Install": bSpawnMinimum = TRUE; default "2. Normal Install": CopyFile("earth2150.exe", "Earth2150.exe"); bNormal = TRUE; endswitch; // MessageBox( svSetupType, INFORMATION ); if (bNormal || bSpawnNormal) then bIsMusic = TRUE; // MessageBox( "bIsMusic is true.", INFORMATION ); elseif (bMaximum) then bIsVideo = TRUE; bIsMusic = TRUE; // MessageBox( "bIsMusic & bIsVideo is true.", INFORMATION ); endif; nDisk = 1; SetStatusWindow( 0, "" ); Disable( DIALOGCACHE ); Disable( FEEDBACK_FULL ); Enable( STATUS ); if ((!bMinimum) && (!bSpawnMinimum)) then StatusUpdate( ON, 30 ); else StatusUpdate( ON, 100 ); endif; nResult = ComponentMoveData( MEDIA, nDisk, 0 ); if (bIsVideo && bIsMusic) then FindCD(); PlaceBitmap( BMP_PATH1, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH2, nID_BITMAP, nDx, nDy, CENTERED); VarSave( SRCTARGETDIR ); SRCDIR = SRCDIR ^ "Game\\Music"; TARGETDIR = TARGETDIR ^ "Music"; StatusUpdate( ON, 35 ); XCopyFile( "E*.*", "", COMP_NORMAL ); StatusUpdate( ON, 40 ); XCopyFile( "L*.*", "", COMP_NORMAL ); PlaceBitmap( BMP_PATH2, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH3, nID_BITMAP, nDx, nDy, CENTERED); StatusUpdate( ON, 45 ); XCopyFile( "M*.*", "", COMP_NORMAL ); StatusUpdate( ON, 50 ); XCopyFile( "U*.*", "", COMP_NORMAL ); VarRestore( SRCTARGETDIR ); PlaceBitmap( BMP_PATH3, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH4, nID_BITMAP, nDx, nDy, CENTERED); VarSave( SRCTARGETDIR ); SRCDIR = SRCDIR ^ "Game\\Video"; TARGETDIR = TARGETDIR ^ "Video"; StatusUpdate( ON, 75 ); XCopyFile( "c*.*", "", COMP_NORMAL ); PlaceBitmap( BMP_PATH4, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH5, nID_BITMAP, nDx, nDy, CENTERED); StatusUpdate( ON, 85 ); XCopyFile( "i*.*", "", COMP_NORMAL ); StatusUpdate( ON, 95 ); XCopyFile( "o*.*", "", COMP_NORMAL ); StatusUpdate( ON, 100 ); XCopyFile( "v*.*", "", COMP_NORMAL ); VarRestore( SRCTARGETDIR ); bIsMusic = FALSE; PlaceBitmap( BMP_PATH5, nID_BITMAP, nDx, nDy, REMOVE); endif; if (bIsMusic) then FindCD(); PlaceBitmap( BMP_PATH1, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH2, nID_BITMAP, nDx, nDy, CENTERED); VarSave( SRCTARGETDIR ); SRCDIR = SRCDIR ^ "Game\\Music"; TARGETDIR = TARGETDIR ^ "Music"; StatusUpdate( ON, 50 ); XCopyFile( "E*.*", "", COMP_NORMAL ); StatusUpdate( ON, 60 ); XCopyFile( "L*.*", "", COMP_NORMAL ); PlaceBitmap( BMP_PATH2, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH3, nID_BITMAP, nDx, nDy, CENTERED); StatusUpdate( ON, 80 ); XCopyFile( "M*.*", "", COMP_NORMAL ); StatusUpdate( ON, 100 ); XCopyFile( "U*.*", "", COMP_NORMAL ); VarRestore( SRCTARGETDIR ); PlaceBitmap( BMP_PATH3, nID_BITMAP, nDx, nDy, REMOVE); PlaceBitmap( BMP_PATH4, nID_BITMAP, nDx, nDy, CENTERED); VarSave( SRCTARGETDIR ); endif; HandleMoveDataError( nResult ); Disable( STATUS ); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: FindCD() // /////////////////////////////////////////////////////////////////////////////// function FindCD() STRING szPath, szFileName, svResult; NUMBER nResult, nID_BITMAP, nDx, nDy; begin PlaceBitmap( BMP_PATH1, nID_BITMAP, nDx, nDy, CENTERED); szPath = SRCDIR; szFileName = "Data2.tag"; svResult = ""; MessageBox(@DISK_2, INFORMATION); nResult = FindFile (szPath, szFileName, svResult); if (nResult = 0) then // MessageBox(svResult, INFORMATION); // MessageBox(szFileName, INFORMATION); // MessageBox(szPath, INFORMATION); // StatusUpdate( ON, 100 ); // XCopyFile( "*.*", "", COMP_NORMAL ); else FindCD(); // MessageBox( "recurse", INFORMATION ); endif; return 0; end; /////////////////////////////////////////////////////////////////////////////// // // Function: HandleMoveDataError // // Purpose: This function handles the error (if any) during the file transfer // operation. // /////////////////////////////////////////////////////////////////////////////// function HandleMoveDataError( nResult ) STRING szErrMsg, svComponent , svFileGroup , svFile; begin svComponent = ""; svFileGroup = ""; svFile = ""; switch (nResult) case 0: return 0; default: ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); szErrMsg = @ERROR_MOVEDATA + "\n\n" + @ERROR_COMPONENT + " " + svComponent + "\n" + @ERROR_FILEGROUP + " " + svFileGroup + "\n" + @ERROR_FILE + " " + svFile; SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); bInstallAborted = TRUE; return nResult; endswitch; end; /////////////////////////////////////////////////////////////////////////////// // // Function: ProcessAfterDataMove // // Purpose: This function performs any necessary operations needed after // all files have been transferred. // /////////////////////////////////////////////////////////////////////////////// function ProcessAfterDataMove() STRING szReferenceFile, szMsg; begin // TO DO : update self-registered files and other processes that // should be performed after the files have been transferred. // // If you are installing self-registering files using the // batch method, remove the slashes from the lines below: // // if Do ( SELFREGISTRATIONPROCESS ) < 0 then // szMsg = "File(s) failed to self-register: \n" + ERRORFILENAME; // MessageBox (szMsg, WARNING); // endif; // DeinstallSetReference specifies a file to be checked before // uninstallation. If the file is in use, uninstallation will not proceed. szReferenceFile = svDir ^ @PRODUCT_KEY; // TO DO : If your file is in a // subfolder of svDir add that here DeinstallSetReference( szReferenceFile ); return 0; end; /////////////////////////////////////////////////////////////////////////////// // // Function: SetupRegistry // // Purpose: This function makes the registry entries for this setup. // /////////////////////////////////////////////////////////////////////////////// function SetupRegistry() NUMBER nResult; begin // TO DO : Add all your registry entry keys here. // Call registry functions and/or create keys from // the InstallShield IDE's Resources pane. nResult = CreateRegistrySet( "" ); RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); RegDBSetKeyValueEx ("Software\\Topware", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150", "Language", REGDB_STRING, "ENGLISH", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150", "Version", REGDB_STRING, "1.0", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame", "Version", REGDB_STRING, "2.3", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame", "Guid", REGDB_STRING, "{9CAEEA89-0174-4aac-9544-9EBF76CCAB8E}", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\FileSystem", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\FileSystem", "OutputDir", REGDB_STRING, TARGETDIR, -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\FileSystem", "DataPath", REGDB_STRING, TARGETDIR + "/>;" + SRCDIR ^ "Game/>", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "Serial", REGDB_NUMBER, "00000000", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "EarthNet", REGDB_NUMBER, "00000000", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "DPLobby", REGDB_NUMBER, "00000001", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\EarthNet", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\EarthNet", "AddressIP", REGDB_STRING, "\\\"TopWare Germany\\\"\\\"62.156.184.220\\\"", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\DPLobby", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\DPLobby\\MSN Gaming Zone", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\DPLobby\\MSN Gaming Zone", "ProviderSite", REGDB_STRING, "http://www.zone.com/earth2150", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Sound", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Sound", "SoundType", REGDB_NUMBER, "00000002", -1); RegDBSetKeyValueEx ("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "Guid", REGDB_STRING, "{9CAEEA89-0174-4aac-9544-9EBF76CCAB8E}", -1); RegDBSetKeyValueEx ("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "File", REGDB_STRING, "EARTH2150.exe", -1); RegDBSetKeyValueEx ("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "CommandLine", REGDB_STRING, "", -1); RegDBSetKeyValueEx ("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "Path", REGDB_STRING, TARGETDIR, -1); RegDBSetKeyValueEx ("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "CurrentDirectory", REGDB_STRING, TARGETDIR, -1); // Launcher //RegDBSetKeyValueEx("Software\\Microsoft\\DirectPlay\\Applications\\Earth 2150", "Launcher", REGDB_STRING, "EARTH2150.EXE", -1); RegDBSetDefaultRoot (HKEY_CURRENT_USER); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\FileSystem", "OutputDir", REGDB_STRING, TARGETDIR, -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\FileSystem", "DataPath", REGDB_STRING, TARGETDIR + "/>;" + SRCDIR ^ "Game/>", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "Serial", REGDB_NUMBER, "00000000", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "EarthNet", REGDB_NUMBER, "00000000", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\Enumeration", "DPLobby", REGDB_NUMBER, "00000001", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Sound", "SoundType", REGDB_NUMBER, "00000002", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Graphics\\Enumeration", "Glide", REGDB_NUMBER, "00000001", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Graphics\\Enumeration", "OpenGL", REGDB_NUMBER, "00000001", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Graphics\\Enumeration", "Direct3D", REGDB_NUMBER, "00000001", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Graphics\\Enumeration", "Hardware", REGDB_NUMBER, "00000001", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Graphics\\Enumeration", "Software", REGDB_NUMBER, "00000000", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\DPLobby\\MSN Gaming Zone", "ProviderSite", REGDB_STRING, "http://www.zone.com/earth2150", -1); RegDBSetKeyValueEx ("Software\\Topware\\Earth 2150\\BaseGame\\Network\\DPLobby\\MSN Gaming Zone", "ProviderGuid", REGDB_STRING, "{bdd4b95c-d35c-11d0-b625-00c04fc33ea1}", -1); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: SetupFolders // // Purpose: This function creates all the folders and shortcuts for the // setup. This includes program groups and items for Windows 3.1. // /////////////////////////////////////////////////////////////////////////////// function SetupFolders() NUMBER nResult, nParameter; STRING szShortCutKey, szExe, szSpawn, szReadme, szSetup, szGamingZone, szWebSite, szAOL5; begin // TO DO : Add all your folders (or program groups) along with shortcuts (or // program items). Call CreateProgramFolder and AddFolderIcon, and/or create // shortcuts etc. from the InstallShield IDE's Resources pane. // // Note : for 16-bit setups you should add an uninstaller icon pointing to // your log file. Under 32-bit this is automatically done by Windows. szShortCutKey = ""; szSpawn = TARGETDIR ^ "earth2150Spawn.exe"; szExe = TARGETDIR ^ "earth2150.exe"; szReadme = TARGETDIR ^ "readme.rtf"; szSetup = TARGETDIR ^ "setup.exe"; szGamingZone = TARGETDIR ^ "earth2150-.url"; szWebSite = TARGETDIR ^ "www.earth2150.com-.url"; nParameter = TRUE; LongPathToQuote (szSpawn, nParameter); LongPathToQuote (szExe, nParameter); LongPathToQuote (szReadme, nParameter); LongPathToQuote (szSetup, nParameter); LongPathToQuote (szGamingZone, nParameter); LongPathToQuote (szWebSite, nParameter); if (svSetupType == "5. Spawn Normal Install")then AddFolderIcon (svDefGroup2, "Earth 2150 Spawn", szSpawn, TARGETDIR, TARGETDIR ^ "earth2150Spawn.exe", 0, szShortCutKey, REPLACE); elseif(svSetupType == "4. Spawn Minimum Install") then AddFolderIcon (svDefGroup2, "Earth 2150 Spawn", szSpawn, TARGETDIR, TARGETDIR ^ "earth2150Spawn.exe", 0, szShortCutKey, REPLACE); else AddFolderIcon (svDefGroup2, "Earth 2150", szExe, TARGETDIR, TARGETDIR ^ "earth2150.exe", 0, szShortCutKey, REPLACE); endif; AddFolderIcon (svDefGroup2, "ReadMe", szReadme, TARGETDIR, WINDIR ^ "write.exe", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup2, "Setup", szSetup, TARGETDIR, TARGETDIR ^ "setup.exe", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup2, "Earth 2150 MSN Gaming Zone", szGamingZone, TARGETDIR, "", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup2, "Earth 2150 Web Site", szWebSite, TARGETDIR, "", 0, szShortCutKey, REPLACE); nResult = CreateShellObjects( "" ); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // RunEReg() // /////////////////////////////////////////////////////////////////////////////// function RunEReg() STRING szERegCommand1, szERegCmdLine1, szERegIniDir, svResult,szERegCommand2, szERegIcon; NUMBER nvValue, nResult; BOOL EReg; begin EReg = FALSE; if (bvCheck7) then szERegCommand1 = SRCDIR ^ "EReg\\EReg32.exe"; szERegCmdLine1 = "/chained"; LaunchAppAndWait( szERegCommand1, szERegCmdLine1, WAIT ); szERegIniDir = WINDIR ^ "BBStore\\Scopeusr\\Software" ^ "The Learning Company" ^ @COMPANY_NAME ^ @PRODUCT_NAME ^ @PRODUCT_VERSION; if (FindFile( szERegIniDir, "ereg.ini", svResult ) = 0) then GetProfInt( szERegIniDir ^ "ereg.ini", "Product Info (EReg)", "registered flag", nvValue ); if (nvValue = 1) then EReg = TRUE; endif; endif; if (!EReg) then VarSave( SRCTARGETDIR ); SRCDIR = SRCDIR ^ "EReg"; TARGETDIR = TARGETDIR ^ "EReg"; XCopyFile( "*.*", "", COMP_NORMAL ); szERegCommand2 = TARGETDIR ^ "EReg32.exe"; LongPathToQuote( szERegCommand2, TRUE ); szERegCommand2 = szERegCommand2 + " /chained"; szERegIcon = TARGETDIR ^ "EReg32.exe"; nResult = AddFolderIcon( @FOLDER_NAME, "Complete Registration", szERegCommand2, TARGETDIR, szERegIcon, 0, "", NULL ); VarRestore( SRCTARGETDIR ); endif; else szERegIniDir = WINDIR ^ "BBStore\\Scopeusr\\Software" ^ "The Learning Company" ^ @COMPANY_NAME ^ @PRODUCT_NAME ^ @PRODUCT_VERSION; if (FindFile( szERegIniDir, "ereg.ini", svResult ) = 0) then GetProfInt( szERegIniDir ^ "ereg.ini", "Product Info (EReg)", "registered flag", nvValue ); if (nvValue = 1) then EReg = TRUE; endif; endif; if (!EReg) then VarSave( SRCTARGETDIR ); SRCDIR = SRCDIR ^ "EReg"; TARGETDIR = TARGETDIR ^ "EReg"; XCopyFile( "*.*", "", COMP_NORMAL ); szERegCommand2 = TARGETDIR ^ "EReg32.exe"; LongPathToQuote( szERegCommand2, TRUE ); szERegCommand2 = szERegCommand2 + " /chained"; szERegIcon = TARGETDIR ^ "EReg32.exe"; nResult = AddFolderIcon( svDefGroup2, "Complete Registration", szERegCommand2, TARGETDIR, szERegIcon, 0, "", NULL ); VarRestore( SRCTARGETDIR ); endif; endif; end; /////////////////////////////////////////////////////////////////////////////// // // Function: CleanUpInstall // // Purpose: This cleans up the setup. Anything that should // be released or deleted at the end of the setup should // be done here. // /////////////////////////////////////////////////////////////////////////////// function CleanUpInstall() begin if (bInstallAborted) then return 0; endif; DialogShowSdFinishReboot(); if (BATCH_INSTALL) then // ensure locked files are properly transferred CommitSharedFiles(0); endif; return 0; end; /////////////////////////////////////////////////////////////////////////////// // // Function: SetupInstall // // Purpose: This will initialize the setup. Any general initialization // needed for the installation should be performed here. // /////////////////////////////////////////////////////////////////////////////// function SetupInstall() begin Enable( CORECOMPONENTHANDLING ); bInstallAborted = FALSE; // Create list of end user selections to be displayed by DialogShowSdStartCopy() // if (bIs32BitSetup) then svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; else svDir = PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use short names endif; TARGETDIR = svDir; SdProductName( @PRODUCT_NAME ); Enable( DIALOGCACHE ); return 0; end; /////////////////////////////////////////////////////////////////////////////// // // Function: SetupScreen // // Purpose: This function establishes the screen look. This includes // colors, fonts, and text to be displayed. // /////////////////////////////////////////////////////////////////////////////// function SetupScreen() begin Enable( FULLWINDOWMODE ); Enable( INDVFILESTATUS ); SetTitle( "", 24, WHITE ); SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. SetColor (BACKGROUND, BK_SOLIDBLACK); Enable( BACKGROUND ); Delay( 1 ); end; /////////////////////////////////////////////////////////////////////////////// // // Function: CheckRequirements // // Purpose: This function checks all minimum requirements for the // application being installed. If any fail, then the user // is informed and the setup is terminated. // /////////////////////////////////////////////////////////////////////////////// function CheckRequirements() NUMBER nvDx, nvDy, nvResult; STRING svResult; begin bIsShellExplorer = FALSE; bIsWindowsNT4 = FALSE; bIsWindowsNT351 = FALSE; bIsWindows95 = FALSE; bIsWindows98 = FALSE; // Check screen resolution. GetExtents( nvDx, nvDy ); if (nvDy < 480) then MessageBox( @ERROR_VGARESOLUTION, WARNING ); abort; endif; // Set 'setup' operation mode bIs32BitSetup = TRUE; GetSystemInfo( ISTYPE, nvResult, svResult ); if (nvResult = 16) then bIs32BitSetup = FALSE; // running 16-bit setup return 0; // no additional information required endif; // --- 32-bit testing after this point --- // Determine the target system's operating system. GetSystemInfo( OS, nvResult, svResult ); if (nvResult = IS_WINDOWSNT) then // Check to see if OS is Windows NT 4.0 or Windows NT 3.51, // and if the shell being used is the Explorer shell. if (GetSystemInfo( WINMAJOR, nvResult, svResult ) = 0) then if (nvResult >= 4) then bIsShellExplorer = TRUE; bIsWindowsNT4 = TRUE; else bIsWindowsNT351 = TRUE; endif; endif; elseif (nvResult = IS_WINDOWS9X) then bIsShellExplorer = TRUE; // Check to see if OS is Windows 95 or Windows 98 GetSystemInfo (WINMINOR, nvResult, svResult); if (nvResult < 10) then bIsWindows95 = TRUE; else bIsWindows98 = TRUE; endif; endif; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdWelcome // // Purpose: This function handles the standard welcome dialog. // // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdWelcome() NUMBER nResult, nvResult; STRING szTitle, szMsg, svResult; begin /////////////////////////////////////////////////////////////////////////////// // // AskYesNo for memory specs // ///////////////////////////////////////////////////////////////////////////// nvResult = 0; svResult = ""; GetSystemInfo (EXTENDEDMEMORY, nvResult, svResult); if (nvResult < 32000) then SetDialogTitle (DLG_ASK_YESNO, @NO_MEMORY); if (AskYesNo(@MEMORY, NO) = NO) then bInstallAborted = TRUE; CleanUpInstall(); endif; endif; szTitle = ""; szMsg = ""; DialogSetInfo (DLG_INFO_ALTIMAGE, "", -1); nResult = SdWelcome( szTitle, szMsg ); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdLicense // // Purpose: This function displays the license agreement dialog. // // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdLicense() NUMBER nResult; STRING szTitle, szMsg, szQuestion, szLicenseFile; begin szLicenseFile = SUPPORTDIR ^ "license.txt"; szTitle = ""; szMsg = ""; szQuestion = ""; DialogSetInfo (DLG_INFO_ALTIMAGE, "", -1); nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile ); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdSetupTypeEx // // Purpose: This function displays the custom component dialog. // // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdSetupTypeEx() NUMBER nResult, nvResult, nData; STRING szTitle, szMsg, svResult, svMediaSaver; begin szTitle = ""; szMsg = ""; DialogSetInfo (DLG_INFO_ALTIMAGE, "", -1); //original ///////////////////////////////////////////////////// svSetupType = "2. Normal Install"; svSetupType2 = svSetupType; nResult = SdSetupTypeEx (szTitle, szMsg, "", svSetupType, 0); switch (svSetupType) case "1. Minimum Install": nDriveSpaceMB = 276; case "3. Maximum Install": nDriveSpaceMB = 786; case "5. Spawn Normal Install": nDriveSpaceMB = 336; case "4. Spawn Minimum Install": nDriveSpaceMB = 276; case "2. Normal Install": nDriveSpaceMB = 336; // default: // nDriveSpaceMB = 0; endswitch; return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdAskDestPath // // Purpose: This function displays the standard folder selection dialog. // // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdAskDestPath() STRING szTitle, szMsg; NUMBER nReserved, nResult; begin szTitle = ""; szMsg = ""; DialogSetInfo (DLG_INFO_ALTIMAGE, "", -1); TARGETDIR = svDir; nResult = SdAskDestPath (szTitle, szMsg, svDir, 0); TARGETDIR = svDir; return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdSelectFolder // // Purpose: This function displays the standard folder selection dialog. // // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdSelectFolder() NUMBER nResult, nItem, nvResult, nOperation; STRING szTitle, szMsg , svResult, svReturnString, szPath; begin szTitle = ""; szMsg = ""; svDefGroup2 = DEF_FOLDER; DialogSetInfo (DLG_INFO_ALTIMAGE, "", -1); nResult = SdSelectFolder (szTitle, szMsg, svDefGroup2); szPath = TARGETDIR; nOperation = DISK; ParsePath (svReturnString, szPath, nOperation); nItem = DISK_TOTALSPACE_EX; nvResult = MBYTES; svResult = svReturnString; GetSystemInfo (nItem, nvResult, svResult); if (nDriveSpaceMB > nvResult) then MessageBox (@NO_DISKSPACE, SEVERE); bInstallAborted = TRUE; CleanUpInstall(); endif; return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowAskOptions // /////////////////////////////////////////////////////////////////////////////// function DialogShowAskOptions() STRING szTitle, szMsg1, szMsg2, szId, szComponents, szMsg, szText1, szText2, szText3, szText4, szText5, svValue, szText6, szText7; NUMBER nValue, nResult, nResult2, nvType, nvSize, nValue4, nDialogId; begin szTitle = ""; nValue = NONEXCLUSIVE; szMsg = @ASK_COMPONENTS; szText1 = @ASK_DIRECTX; bvCheck1 = TRUE; szText2 = @ASK_MEDIA_PLAYER; bvCheck2 = TRUE; szText3 = @ASK_GAMING_ZONE; bvCheck3 = FALSE; szText4 = @ASK_AOL; bvCheck4 = FALSE; szText5 = @ASK_SHORTCUT; bvCheck5 = FALSE; szText6 = @OPT_README; bvCheck6 = FALSE; szText7 = "Registration"; bvCheck7 = TRUE; nResult = AskOptions (nValue, szMsg, szText1, bvCheck1, szText2, bvCheck2, szText3, bvCheck3, szText4, bvCheck4, szText5, bvCheck5, szText6, bvCheck6, szText7, bvCheck7); if (nResult = 1) then RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); /////////////////////////////////////////////////////////////////////////////// // // DirectX 7a Checker // /////////////////////////////////////////////////////////////////////////////// // Asks to Reinstall if user has current version if (bvCheck1) then nResult2 = RegDBKeyExist ("Software\\Microsoft\\DirectX"); if (nResult2 = 1) then nResult2 = RegDBGetKeyValueEx ("Software\\Microsoft\\DirectX", "Version", nvType, svValue, nvSize); if (svValue >= "4.07.00.0716") then SetDialogTitle (DLG_ASK_YESNO, szTitle); if (AskYesNo(@CURRENT_DIRECTXA, YES) = NO) then bvCheck1 = FALSE; endif; endif; endif; endif; // Asks to Install if user does not have current version if (!bvCheck1) then nResult2 = RegDBKeyExist ("Software\\Microsoft\\DirectX"); if (nResult2 = 1) then nResult2 = RegDBGetKeyValueEx ("Software\\Microsoft\\DirectX", "Version", nvType, svValue, nvSize); //StrToNum(nValue4, svValue); if (svValue < "4.07.00.0700") then SetDialogTitle (DLG_ASK_YESNO, szTitle); if (AskYesNo(@NOT_DIRECTX, YES) = YES) then bvCheck1 = TRUE; endif; elseif (svValue = "4.07.00.0700") then SetDialogTitle (DLG_ASK_YESNO, szTitle); if (AskYesNo(@MAYNOT_DIRECTXA, YES) = YES) then bvCheck1 = TRUE; endif; endif; endif; endif; /////////////////////////////////////////////////////////////////////////////// // // MS Media Player Checker // /////////////////////////////////////////////////////////////////////////////// // Asks to Reinstall if user has current version if (bvCheck2) then nResult2 = RegDBKeyExist ("Software\\Microsoft\\MediaPlayer\\Setup"); if (nResult2 = 1) then nResult2 = RegDBGetKeyValueEx ("Software\\Microsoft\\MediaPlayer\\Setup", "SetupVersion", nvType, svValue, nvSize); if (svValue >= "6.4") then SetDialogTitle (DLG_ASK_YESNO, szTitle); if (AskYesNo(@CURRENT_MEDIAPLAYER, YES) = NO) then bvCheck2 = FALSE; endif; endif; endif; endif; // Asks to Install if user does not have current version if (!bvCheck2) then nResult2 = RegDBKeyExist ("Software\\Microsoft\\MediaPlayer\\Setup"); if (nResult2 = 1) then nResult2 = RegDBGetKeyValueEx ("Software\\Microsoft\\MediaPlayer\\Setup", "SetupVersion", nvType, svValue, nvSize); if (svValue < "6.4") then SetDialogTitle (DLG_ASK_YESNO, szTitle); if (AskYesNo(@NOT_MEDIAPLAYER, YES) = YES) then bvCheck2 = TRUE; endif; endif; endif; endif; /////////////////////////////////////////////////////////////////////////////// // // MSN Gaming Zone Checker // /////////////////////////////////////////////////////////////////////////////// // Asks to Reinstall if user has current version if (bvCheck3) then nResult2 = RegDBKeyExist ("Software\\Microsoft\\Internet Gaming Zone\\6.00.000"); if (nResult2 = 1) then SetDialogTitle (DLG_ASK_YESNO, szTitle); if (AskYesNo(@CURRENT_GAMINGZONE, YES) = NO) then bvCheck3 = FALSE; endif; endif; endif; endif; return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // MediaPlayer Launching // /////////////////////////////////////////////////////////////////////////////// function MediaPlayerHandler() STRING szFile, szCommand2, szCmdLine2; NUMBER nResult; LIST list1; begin Disable( BACKBUTTON ); szCommand2 = SRCDIR ^ "MediaPlayer64\\mpfull.exe"; szCmdLine2 = "/R:N"; RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); RegDBSetKeyValueEx ("Software\\Microsoft\\MediaPlayer\\Setup", "URLAtCompletion", REGDB_STRING, "[No]", -1); LaunchAppAndWait(szCommand2, szCmdLine2, WAIT); return 0; 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 nIcon, nFlag, nResult, nParameter; STRING szProgramFolder, szShortCutKey, szItemName, szCommandLine, szWorkingDir, szIconPath, szTitle, szMsg1, szMsg2, szOption1, szOption2, szCommand1, szCmdLine1, szCommand2, szCmdLine2, szCommand3, szCmdLine3, szCommand4, szCmdLine4, szCommand5, szCmdLine5, szCommand6, szCmdLine6, szCommand7, szCmdLine7, szReadme, szLicenseFile, szQuestion, szMsg; BOOL bOpt1, bOpt2; begin CopyFile("readme.rtf", "readme.rtf"); szCommand1 = SRCDIR + "directx7a\\DX7Aeng.exe"; szCmdLine1 = ""; szCommand3 = SRCDIR + "GamingZone\\zonea660.exe"; szCmdLine3 = ""; szCommand4 = WINDIR + "WRITE.EXE"; szCmdLine4 = TARGETDIR ^ "readme.rtf"; szCommand6 = SRCDIR + "a2.exe"; szCmdLine6 = ""; szCommand7 = SRCDIR + "AOL 5 setup\\aol50us.exe"; szCmdLine7 = ""; LongPathToQuote (szCmdLine4, TRUE); // AOL 5 if (bvCheck4 = TRUE) then LaunchAppAndWait(szCommand7, szCmdLine7, WAIT); endif; // DESKTOP SHORTCUT if (bvCheck5 == TRUE) then if (svSetupType == "5. Spawn Normal Install")then szProgramFolder = FOLDER_DESKTOP; szItemName = @SPAWN_SHORTCUT; szCommandLine = TARGETDIR ^ "earth2150Spawn.exe"; szWorkingDir = TARGETDIR; szIconPath = TARGETDIR ^ "earth2150Spawn.exe"; nIcon = 0; szShortCutKey = ""; nFlag = REPLACE; LongPathToQuote (szCommandLine, TRUE); AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag); elseif (svSetupType == "4. Spawn Minimum Install") then szProgramFolder = FOLDER_DESKTOP; szItemName = @SPAWN_SHORTCUT; szCommandLine = TARGETDIR ^ "earth2150Spawn.exe"; szWorkingDir = TARGETDIR; szIconPath = TARGETDIR ^ "earth2150Spawn.exe"; nIcon = 0; szShortCutKey = ""; nFlag = REPLACE; LongPathToQuote (szCommandLine, TRUE); AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag); else szProgramFolder = FOLDER_DESKTOP; szItemName = @PRODUCT_NAME; szCommandLine = TARGETDIR ^ "earth2150.exe"; szWorkingDir = TARGETDIR; szIconPath = TARGETDIR ^ "earth2150.exe"; nIcon = 0; szShortCutKey = ""; nFlag = REPLACE; LongPathToQuote (szCommandLine, TRUE); AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag); endif; endif; // MS MEDIA PLAYER if (bvCheck2 = TRUE) then MediaPlayerHandler(); endif; // MSN GAMING ZONE if (bvCheck3 = TRUE) then SdShowMsg( @PLEASE_WAIT, TRUE ); LaunchAppAndWait(szCommand3, szCmdLine3, WAIT); SdShowMsg( @PLEASE_WAIT, FALSE ); endif; bOpt1 = FALSE; bOpt2 = FALSE; szMsg1 = @SUCCESSFUL; szMsg2 = @START; szOption1 = ""; szOption2 = ""; nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); // README if (bvCheck6 = TRUE) then LaunchApp(szCommand4, szCmdLine4); endif; // DIRECTX 7 if (bvCheck1 = TRUE) then LaunchApp(szCommand1, szCmdLine1); elseif(svSetupType != "5. Spawn Normal Install")then if(svSetupType != "4. Spawn Minimum Install") then // else launch AUTORUN LaunchApp(szCommand6, szCmdLine6); endif; endif; return nResult; end; // --- include script file section --- #include "sddialog.rul"