//////////////////////////////////////////////////////////////////////////////// // // File Name: Setup.rul // // Description: InstallShield script // // Comments: This script was generated based on the selections you made in // the Project Wizard. Refer to the help topic entitled "Modify // the script that the Project Wizard generates" for information // on possible next steps. // //////////////////////////////////////////////////////////////////////////////// // Include header files #include "ifx.h" ////////////////////// string defines //////////////////////////// //////////////////// installation declarations /////////////////// // ----- DLL function prototypes ----- // your DLL function prototypes // ---- script function prototypes ----- // your script function prototypes prototype rs(BYREF STRING); // your global variables STRING svAdminPassword; ////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnFirstUIBefore // // EVENT: FirstUIBefore event is sent when installation is run for the first // time on given machine. In the handler installation usually displays // UI allowing end user to specify installation parameters. After this // function returns, FeatureTransferData is called to perform file // transfer. // /////////////////////////////////////////////////////////////////////////////// function OnFirstUIBefore() number nResult; string szTitle, szMsg, szField1; string szLicenseFile, szQuestion; string szDir; string szFeatures, szTargetdir; string svSetupType; number nLevel; LIST list; begin // TO DO: if you want to enable background, window title, and caption bar title // SetTitle( @PRODUCT_NAME, 24, WHITE ); // SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION ); // Enable( FULLWINDOWMODE ); // Enable( BACKGROUND ); // SetColor(BACKGROUND,RGB (0, 128, 128)); SHELL_OBJECT_FOLDER = @PRODUCT_NAME; szDir = INSTALLDIR; Dlg_Start: // beginning of dialogs label Dlg_SdWelcome: szTitle = ""; szMsg = ""; nResult = SdWelcome( szTitle, szMsg ); if (nResult = BACK) goto Dlg_Start; Dlg_SdLicense: szLicenseFile = SUPPORTDIR ^ "license.txt"; szTitle = ""; szMsg = ""; szQuestion = ""; nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile ); if (nResult = BACK) goto Dlg_SdWelcome; Dlg_SdAskDestPath: szTitle = ""; szMsg = ""; nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 ); INSTALLDIR = szDir; if (nResult = BACK) goto Dlg_SdLicense; Dlg_SetupType: szTitle = ""; szMsg = ""; svSetupType = "LocalLibrary"; nResult = SdSetupTypeEx ( szTitle , szMsg , "" , svSetupType , 0 ); if (nResult = BACK) goto Dlg_SdAskDestPath; Dlg_SdFeatureTree: szTargetdir = INSTALLDIR; nLevel = 2; // show the full feature tree if doing a custom install or // just the list of collections if not if (svSetupType = "Custom") then szFeatures = ""; szTitle = ""; szMsg = ""; nResult = SdFeatureTree(szTitle, szMsg, szTargetdir, szFeatures, nLevel); else szFeatures = "Collections"; szTitle = @TEXT_SELECT_COLLECTIONS; szMsg = @TEXT_SELECT_COLLECTIONS_DESC; nResult = SdFeatureTree(szTitle, szMsg, szTargetdir, szFeatures, nLevel); endif; if (nResult = BACK) goto Dlg_SetupType; Dlg_SdDlgEdit1: // get the admin password from the user svAdminPassword = "admin"; // the default szTitle = @TEXT_ADMIN_PW; szMsg = @TEXT_ADMIN_PW_DESC; szField1 = @TEXT_PW; nResult = SdShowDlgEdit1(szTitle, szMsg, szField1, svAdminPassword); if (nResult = BACK) goto Dlg_SdFeatureTree; Enable(STATUSEX); return 0; end; /////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnMaintUIBefore // // EVENT: MaintUIBefore event is sent when end user runs installation that // has already been installed on the machine. Usually this happens // through Add/Remove Programs applet. In the handler, installation // usually displays UI allowing end user to modify existing installation // or uninstall application. After this function returns, // FeatureTransferData is called to perform file transfer. // /////////////////////////////////////////////////////////////////////////////// function OnMaintUIBefore() NUMBER nResult, nType; STRING szTitle, szMsg, svDir, svResult, szCaption; begin // TO DO: if you want to enable background, window title, and caption bar title // SetTitle( @PRODUCT_NAME, 24, WHITE ); // SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION ); // SetColor(BACKGROUND,RGB (0, 128, 128)); // Enable( FULLWINDOWMODE ); // Enable( BACKGROUND ); Dlg_Start: Disable(BACKBUTTON); nType = SdWelcomeMaint(szTitle, szMsg, MODIFY); Enable(BACKBUTTON); if (nType = REMOVEALL) then svResult = SdLoadString(IFX_MAINTUI_MSG); szCaption = SdLoadString(IFX_ONMAINTUI_CAPTION); nResult = SprintfBox(MB_OKCANCEL,szCaption,"%s",svResult); if (nResult = IDCANCEL) goto Dlg_Start; endif; nResult = NEXT; Dlg_SdFeatureTree: if (nType = MODIFY) then szTitle = ""; szMsg = ""; nResult = SdFeatureTree(szTitle, szMsg, TARGETDIR, "", 2); if (nResult = BACK) goto Dlg_Start; endif; switch(nType) case REMOVEALL: ComponentRemoveAll(); case REPAIR: ComponentReinstall(); endswitch; Enable(STATUSEX); end; /////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnEnd // // EVENT: End event is the last event. It is not sent if the installation // has been aborted. In this case Abort event is sent // /////////////////////////////////////////////////////////////////////////////// function OnEnd() NUMBER nvSize; STRING svName; begin if (MAINTENANCE = FALSE) then // offer to install collection organizer if this is a // CD-ROM release nvSize = 256; MsiGetProperty (ISMSI_HANDLE, "ISReleaseFlags", svName, nvSize); if (svName % "CDROM_ONLY") then if (AskYesNo(@TEXT_COLLORG, YES) == YES) then LaunchApp(SRCDIR ^ "windows_utilities" ^ "CollOrganizer.exe", ""); endif; endif; endif; end; // turn any backslashes in string into forward slashes function rs(svString) NUMBER i; begin for i = 0 to StrLength(svString) if (svString[i] = '\\') then svString[i] = '/'; endif; endfor; end; #include "C:\sjboddie\is7_gsdl_cdrom\Greenstone\featureevents.rul"