//////////////////////////////////////////////////////////////////////////////// // // 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 "CSUninst.isu" #define DEF_FOLDER "GAME Studios\\Championship Surfer" #define FOLDER "Championship Surfer" //////////////////// 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 DialogShowAskOptions(); prototype RunEReg(); prototype DialogShowSdShowInfoList(); prototype DialogShowSdSetupTypeEx(); // ----- global variables ------ // generated by the Project Wizard BOOL bIsWindowsNT4, bIsWindowsNT351, bIsWindows98, bIsWindows95; BOOL bIsShellExplorer, bInstallAborted, bIs32BitSetup; STRING svDir; STRING svName, svCompany, svSerial; STRING svDefGroup; STRING szAppPath; STRING svSetupType; // your global variables BOOL bvCheck1, bvCheck2, bvCheck3; /////////////////////////////////////////////////////////////////////////////// // // 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_SdShowInfoList: nResult = DialogShowSdShowInfoList(); if (nResult = BACK) goto Dlg_SdWelcome; Dlg_SdLicense: nResult = DialogShowSdLicense(); if (nResult = BACK) goto Dlg_SdShowInfoList; Dlg_AskOptions: nResult = DialogShowAskOptions(); if (nResult = BACK) goto Dlg_SdLicense; Dlg_SdSetupTypeEx: nResult = DialogShowSdSetupTypeEx(); if (nResult = BACK) goto Dlg_AskOptions; Dlg_SdAskDestPath: nResult = DialogShowSdAskDestPath(); if (nResult = BACK) goto Dlg_SdSetupTypeEx; Dlg_SdSelectFolder: nResult = DialogShowSdSelectFolder(); if (nResult = BACK) goto Dlg_SdAskDestPath; 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; svDir = svDir ^ FOLDER; nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); szProgram = UNINST + " -f" + "\"" + svLogFile + "\""; AddFolderIcon (svDefGroup, "Uninstall", szProgram, WINDIR, "", 0, "", REPLACE); if (nResult < 0) then MessageBox( @ERROR_UNINSTSETUP, WARNING ); endif; szAppPath = TARGETDIR ^ FOLDER; // 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, nvResult, nDisk, nDx, nDy, nDx1, nDy1, nID_BITMAP; STRING svResult; begin PlaceBitmap( SUPPORTDIR + "logo.bmp", nID_BITMAP, nDx1, nDy1, REMOVE); GetSystemInfo (VIDEO, nvResult, svResult); //IS_SVGA - Super VGA (800 x 600) resolution. //IS_XVGA - XVGA (1024 x 768) resolution. //IS_UVGA - Greater than 1024 x 768 resolution. if(nvResult = IS_SVGA) then nDx = 800; nDy = 600; elseif (nvResult = IS_XVGA) then nDx = 1024; nDy = 768; elseif (nvResult = IS_UVGA) then nDx = 1152; nDy = 864; else nDx = 640; nDy = 480; endif; SizeWindow (METAFILE, nDx, nDy); PlaceWindow (BILLBOARD, CENTERED, CENTERED, CENTERED); nDisk = 1; SetStatusWindow( 0, "" ); Enable( DIALOGCACHE ); Disable (FEEDBACK_FULL); Enable( STATUS ); StatusUpdate( ON, 100 ); nResult = ComponentMoveData( MEDIA, nDisk, 0 ); HandleMoveDataError( nResult ); Disable( STATUS ); return nResult; 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\\TLC\\Championship Surfer\\1.0", "Directory", REGDB_STRING, TARGETDIR ^ FOLDER, -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, szWebSite1, szWebSite3, szExe, szReadme, szConfig, szHelp; 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 = ""; szWebSite1 = TARGETDIR ^ FOLDER ^ "TLC.url"; szExe = TARGETDIR ^ FOLDER ^ "Surf.exe"; szReadme = TARGETDIR ^ FOLDER ^ "Readme.txt"; szConfig = TARGETDIR ^ FOLDER ^ "config.exe"; szWebSite3 = TARGETDIR ^ FOLDER ^ "Krome.url"; szHelp = TARGETDIR ^ FOLDER ^ "help.htm"; nParameter = TRUE; LongPathToQuote (szConfig, nParameter); LongPathToQuote (szWebSite1, nParameter); LongPathToQuote (szWebSite3, nParameter); LongPathToQuote (szExe, nParameter); LongPathToQuote (szReadme, nParameter); LongPathToQuote (szHelp, nParameter); AddFolderIcon (svDefGroup, "Configuration Utility", szConfig, TARGETDIR ^ FOLDER, TARGETDIR ^ FOLDER ^ "Config.exe", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup, "TLC", szWebSite1, TARGETDIR ^ FOLDER, "", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup, "Championship Surfer", szExe, TARGETDIR ^ FOLDER, TARGETDIR ^ FOLDER ^ "Surf.exe", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup, "Readme", szReadme, TARGETDIR ^ FOLDER, "", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup, "Krome Studios", szWebSite3, TARGETDIR ^ FOLDER, "", 0, szShortCutKey, REPLACE); AddFolderIcon (svDefGroup, "Help", szHelp, TARGETDIR ^ FOLDER, "", 0, szShortCutKey, REPLACE); nResult = CreateShellObjects( "" ); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // RunEReg() // /////////////////////////////////////////////////////////////////////////////// function RunEReg() STRING svValue, svResult, svVersionNumber, svFileName, szIniDir, szCommand, szCmdLine, szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, szShortCutKey, szTemp, szTemp2, szTemp3; NUMBER nResult, nvResult, nvValue, nIcon, nFlag; BOOL ERegIsInstalled; begin SdShowMsg ("Initializing EReg...", TRUE); //check for 16-bit OS GetSystemInfo (ISTYPE, nvResult, svResult); //EReg only works on 32-bit systems if (nvResult = 16) then MessageBox ("Sorry! Registration is not enabled for 16-bit systems.", SEVERE); return 0; endif; ERegIsInstalled = FALSE; //location of our EReg ini files - please make sure COMPANY_NAME has the same value as the 'family' variable in ereg32.ini or EReg won't work szIniDir = WINDIR ^ "BBStore\\Scopeusr\\Software" ^ "Mattel Interactive" ^ @COMPANY_NAME ^ @PRODUCT_NAME ^ @PRODUCT_VERSION; //see if EReg has already been run for this product if (FindFile (szIniDir, "ereg.ini", svResult) = 0) then GetProfInt (szIniDir ^ "ereg.ini", "Product Info (EReg)", "registered flag", nvValue); if (nvValue <= 0) then ERegIsInstalled = FALSE; else ERegIsInstalled = TRUE; endif; else ERegIsInstalled = FALSE; endif; //run EReg if it's never been run before if (!ERegIsInstalled) then szCommand = SRCDIR ^ "EReg\\EReg32.exe"; szCmdLine = "/chained"; SdShowMsg ("Initializing EReg...", FALSE); LaunchAppAndWait (szCommand, szCmdLine, WAIT); SdShowMsg ("Completing registration procedure...", TRUE); szIniDir = WINDIR ^ "BBStore\\Scopeusr\\Software" ^ "Mattel Interactive" ^ @COMPANY_NAME ^ @PRODUCT_NAME ^ @PRODUCT_VERSION; //Check if user completed EReg, if not ERegIsInstalled remains FALSE nResult = FindFile (szIniDir, "ereg.ini", svResult); if (nResult = 0) then GetProfInt (szIniDir ^ "ereg.ini", "Product Info (EReg)", "registered flag", nvValue); if (nvValue <= 0) then ERegIsInstalled = FALSE; else ERegIsInstalled = TRUE; endif; else ERegIsInstalled = FALSE; endif; endif; //if ERegIsInstalled is FALSE at this point, copy the entire EReg structure to the game directory and //and make a shortcut called Complete Registration that points to it. if (!ERegIsInstalled) then Enable (LOGGING); //all of the following may be uninstalled VarSave (SRCTARGETDIR); SRCDIR = SRCDIR ^ "EReg"; TARGETDIR = TARGETDIR ^ FOLDER ^ "EReg"; nResult = XCopyFile ("*.*", "", COMP_NORMAL); if (nResult < 0) then MessageBox ("Unable to transfer EReg.", SEVERE); else szProgramFolder = DEF_FOLDER; szItemName = "Complete Registration"; szCommandLine = TARGETDIR ^ "EReg32.exe"; LongPathToQuote (szCommandLine, TRUE); szWorkingDir = TARGETDIR; szIconPath = TARGETDIR ^ "EReg32.exe"; nIcon = 0; szShortCutKey = ""; nFlag = REPLACE; nResult = AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag); endif; endif; VarRestore (SRCTARGETDIR); SdShowMsg ("Completing registration procedure...", FALSE); return 0; 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() NUMBER nID_BITMAP, nDx, nDy; begin Enable( FULLWINDOWMODE ); Enable( INDVFILESTATUS ); SetTitle( "", 24, WHITE ); SetColor (BACKGROUND, RGB (4, 28, 124)); SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. PlaceBitmap( SUPPORTDIR + "logo.bmp", nID_BITMAP, nDx, nDy, UPPER_LEFT); 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: DialogShowSdShowInfoList // // Purpose: This function checks the min specs cause no one // read the box before spending $50 // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdShowInfoList() STRING szTitle, szMsg, svReturn, szInfo; NUMBER nvReturn; BOOL bMinCheck; LIST listInfo; begin DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg10.bmp", TRUE); bMinCheck = FALSE; // Create a list to hold system information. listInfo = ListCreate (STRINGLIST); // Check if the system has 16 bit color. GetSystemInfo (COLORS, nvReturn, svReturn); if (nvReturn >= 16) then szInfo = @COLOR_GOOD; bMinCheck = TRUE; else szInfo = @COLOR_BAD; bMinCheck = FALSE; endif; // Add the COLOR info to the list. ListAddString (listInfo, szInfo, AFTER); // Check how much memory the system has. GetSystemInfo (EXTENDEDMEMORY, nvReturn, svReturn); if (nvReturn >= 32) then szInfo = @RAM_GOOD; bMinCheck = TRUE; else szInfo = @RAM_BAD; bMinCheck = FALSE; endif; // Add the memory to the list ListAddString (listInfo, szInfo, AFTER); szInfo = ""; ListAddString (listInfo, szInfo, AFTER); szInfo = ""; ListAddString (listInfo, szInfo, AFTER); szInfo = @NOTE; ListAddString (listInfo, szInfo, AFTER); szInfo = @THREE_D_NOTE; ListAddString (listInfo, szInfo, AFTER); szInfo = @CPU_NOTE; ListAddString (listInfo, szInfo, AFTER); // Set up title and message parameters for call to SdShowInfoList. szTitle = @MIN_CHECK_TITLE; if (bMinCheck = TRUE) then szMsg = @SYS_INFO_GOOD; else szMsg = @SYS_INFO_BAD; endif; // Display the information. SdShowInfoList (szTitle, szMsg, listInfo); end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdWelcome // // Purpose: This function handles the standard welcome dialog. // // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdWelcome() NUMBER nResult; STRING szTitle, szMsg; begin DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg2.bmp", TRUE); szTitle = ""; szMsg = ""; 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 DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg3.bmp", TRUE); szLicenseFile = SUPPORTDIR ^ "license.txt"; szTitle = ""; szMsg = ""; szQuestion = ""; nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile ); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowAskOption // /////////////////////////////////////////////////////////////////////////////// function DialogShowAskOptions() NUMBER nResult, nResult2; NUMBER nvType, nvSize; STRING szMsg, szText1, szText2, szText3; STRING svValue; begin DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg4.bmp", TRUE); szMsg = @ASK; szText2 = @ASK_MEDIA_PLAYER; szText3 = @ASK_AOL; bvCheck2 = FALSE; bvCheck3 = FALSE; /////////////////////////////////////////////////////////////////////////////// // // DirectX 7a Checker // Sees if user has current version // /////////////////////////////////////////////////////////////////////////////// RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); 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 szText1 = @CURRENT_DIRECTX; bvCheck1 = FALSE; else szText1 = @NEEDS_DIRECTX; bvCheck1 = TRUE; endif; endif; nResult = AskOptions (NONEXCLUSIVE, szMsg, szText1, bvCheck1, szText2, bvCheck2, szText3, bvCheck3); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdSetupTypeEx // // Purpose: This function asks the user for the destination // folder and setup type. // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdSetupTypeEx() NUMBER nResult; STRING szTitle, szMsg, szReserved, svSetupType; begin DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg5.bmp", TRUE); szTitle = ""; szMsg = @FOLDER; szReserved = ""; svSetupType = "Typical"; nResult = SdSetupTypeEx (szTitle, szMsg, szReserved, svSetupType, 0); return nResult; end; /////////////////////////////////////////////////////////////////////////////// // // Function: DialogShowSdAskDestPath // // Purpose: This function asks the user for the destination folder. // /////////////////////////////////////////////////////////////////////////////// function DialogShowSdAskDestPath() NUMBER nResult; STRING szTitle, szMsg; begin DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg6.bmp", TRUE); szTitle = ""; szMsg = @FOLDER; 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; STRING szTitle, szMsg; begin DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg7.bmp", TRUE); szTitle = ""; szMsg = ""; svDefGroup = DEF_FOLDER; nResult = SdSelectFolder (szTitle, szMsg, svDefGroup); 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, nIcon, nFlag, nID_BITMAP, nDx, nDy; STRING szTitle, szMsg1, szMsg2, szOption1, szOption2, szCommand1, szCommand2, szCommand3, szCommand4, szCommand5, szCmdLine1, szCmdLine2, szCmdLine3, szCmdLine4, szCmdLine5, szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, szShortCutKey; NUMBER bOpt1, bOpt2; begin VarSave(SRCTARGETDIR); TARGETDIR = TARGETDIR ^ FOLDER; CopyFile("readme.txt", "readme.txt"); CopyFile("surf.exe", "surf.exe"); CopyFile("help.htm", "help.htm"); VarRestore(SRCTARGETDIR); PlaceBitmap( SUPPORTDIR + "logo.bmp", nID_BITMAP, nDx, nDy, UPPER_LEFT); DialogSetInfo (DLG_INFO_ALTIMAGE, SUPPORTDIR + "dlg8.bmp", TRUE); szCommand1 = SRCDIR + "directx7a\\dxsetup.exe"; szCmdLine1 = ""; szCommand2 = SRCDIR + "AOL 5 Setup\\aol50us.exe"; szCmdLine2 = ""; szCommand3 = SRCDIR + "autorun.exe"; szCmdLine3 = ""; szCommand4 = WINDIR + "notepad.exe"; szCmdLine4 = "\"" + SRCDIR ^ "readme.txt" + "\""; szCommand5 = SRCDIR + "MediaPlayer\\mpfull_eng.exe"; szCmdLine5 = ""; SetDialogTitle (DLG_ASK_YESNO, @ASK_SHORTCUT_TITLE); if (AskYesNo (@ASK_SHORTCUT, YES) = YES) then szProgramFolder = FOLDER_DESKTOP; szItemName = @PRODUCT_NAME; szCommandLine = TARGETDIR ^ FOLDER ^ "Surf.exe"; szWorkingDir = TARGETDIR ^ FOLDER; szIconPath = TARGETDIR ^ FOLDER ^ "Surf.exe"; nIcon = 0; szShortCutKey = ""; nFlag = REPLACE; LongPathToQuote (szCommandLine, TRUE); AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag); endif; // AOL 5.0 if (bvCheck3 = TRUE) then LaunchAppAndWait (szCommand2, szCmdLine2, WAIT); endif; // MS Media Player 6.4 if (bvCheck2 = TRUE) then Disable(BACKGROUND); LaunchAppAndWait (szCommand5, szCmdLine5, WAIT); Enable(BACKGROUND); endif; szTitle = ""; szMsg1 = @SUCCESSFUL; szMsg2 = @START; szOption1 = @OPT_README; szOption2 = ""; bOpt1 = TRUE; bOpt2 = FALSE; nResult = SdFinish (szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2); // Readme if (bOpt1) then LaunchApp (szCommand4, szCmdLine4); endif; if (bvCheck1 = TRUE) then // Directx 7a LaunchApp (szCommand1, szCmdLine1); else // Auto-Run LaunchApp (szCommand3, szCmdLine3); endif; return nResult; end; // --- include script file section --- #include "sddialog.rul"