//=========================================================================== // // File Name: Setup.rul // // Description: Blank setup main script file // // Comments: Blank setup is an empty setup project. If you want to // create a new project via. step-by step instructions use the // Project Assistant. // //=========================================================================== // Included header files ---------------------------------------------------- #include "ifx.h" //--------------------------------------------------------------------------- // OnFirstUIBefore // // First Install UI Sequence - Before Move Data // // The OnFirstUIBefore event is called by OnShowUI when the setup is // running in first install mode. By default this event displays UI allowing // the end user to specify installation parameters. // // Note: This event will not be called automatically in a // program...endprogram style setup. //--------------------------------------------------------------------------- function OnFirstUIBefore() number nResult, nLevel, nSize, nSetupType; string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile; string szName, szCompany, szTargetPath, szDir, szFeatures; BOOL bLicenseAccepted; begin // Added in InstallShield 15 - Show an appropriate error message if // -removeonly is specified and the product is not installed. if( REMOVEONLY ) then Disable( DIALOGCACHE ); szMsg = SdLoadString( IDS_IFX_ERROR_PRODUCT_NOT_INSTALLED_UNINST ); SdSubstituteProductInfo( szMsg ); MessageBox( szMsg, SEVERE ); abort; endif; nSetupType = COMPLETE; szDir = TARGETDIR; szName = ""; szCompany = ""; bLicenseAccepted = FALSE; // Beginning of UI Sequence Dlg_Start: nResult = 0; Dlg_SdWelcome: szTitle = ""; szMsg = ""; //{{IS_SCRIPT_TAG(Dlg_SdWelcome) nResult = SdWelcome( szTitle, szMsg ); //}}IS_SCRIPT_TAG(Dlg_SdWelcome) if (nResult = BACK) goto Dlg_Start; Dlg_SdAskDestPath2: szTitle = ""; szMsg = ""; if (nSetupType = CUSTOM) then //{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2) nResult = SdAskDestPath2( szTitle, szMsg, szDir ); //}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2) TARGETDIR = szDir; endif; if (nResult = BACK) goto Dlg_SdWelcome; Dlg_SdStartCopy2: szTitle = ""; szMsg = ""; //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2) nResult = SdStartCopy2( szTitle, szMsg ); //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2) if (nResult = BACK) goto Dlg_SdAskDestPath2; // Added in 11.0 - Set appropriate StatusEx static text. SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) ); return 0; end; //--------------------------------------------------------------------------- // OnMaintUIBefore // // Maintenance UI Sequence - Before Move Data // // The OnMaintUIBefore event is called by OnShowUI when the setup is // running in maintenance mode. By default this event displays UI that // allows the end user to add or remove features, repair currently // installed features or uninstall the application. // // Note: This event will not be called automatically in a // program...endprogram style setup. //--------------------------------------------------------------------------- function OnMaintUIBefore() number nResult, nType; string szTitle, szMsg; begin // nType defaults to MODIFY. nType = MODIFY; //Initialize SQL OnSQLServerInitializeMaint(); // Beginning of UI Sequence Dlg_Start: // Added in Version 9.5 - Support for REMOVEONLY option. if( !REMOVEONLY ) then // In standard mode show maintenance dialog Disable( BACKBUTTON ); nType = SdWelcomeMaint( szTitle, szMsg, nType ); Enable( BACKBUTTON ); nResult = NEXT; else // Hide the initial progress dialog as otherwise the user can // click on it, and hide the MessageBox. Disable( DIALOGCACHE ); // In RemoveOnly mode, set to remove. nType = REMOVEALL; endif; // Show Uninstall Confirmation Dialog if ( nType = REMOVEALL ) then nResult = MessageBox( SdLoadString( IFX_MAINTUI_MSG ), MB_YESNO ); if (nResult != IDYES ) then if( REMOVEONLY ) then // In REMOVEONLY mode, abort the setup. abort; else // In non-REMOVEONLY mode, redisplay the previous dialog. goto Dlg_Start; endif; endif; endif; Dlg_SdFeatureTree: if ( nType = MODIFY ) then szTitle = ""; szMsg = SdLoadString( SD_STR_COMPONENT_MAINT_MSG ); nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, "", -1 ); if ( nResult = BACK ) goto Dlg_Start; endif; ////////////////////////////////////////////////////////////////////////////////////////////// if ( nType = REMOVEALL ) then MessageBox( "Uninstalll test1.", INFORMATION ); // <-- the test line of code endif; ////////////////////////////////////////////////////////////////////////////////////////////// Dlg_ObjDialogs: nResult = ShowObjWizardPages( nResult ); if ( ( nResult = BACK ) && ( nType != MODIFY ) ) goto Dlg_Start; if ( ( nResult = BACK ) && ( nType = MODIFY ) ) goto Dlg_SdFeatureTree; switch(nType) case REMOVEALL: // Ensure that all previously installed features are removed. FeatureRemoveAllInMediaAndLog(); // Added in 11.0 - Set appropriate StatusEx static text. SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) ); case REPAIR: // Changed for DevStudio 9, Disk1 files are now always updated when installed // so when running from ADDREMOVE we need to prevent these files from being // updated since this will result in files being updated that are locked by the setup. // Updating these files when running from ADDREMOVE should not be needed since updates // are not run directly from Add/Remove. if( ADDREMOVE ) then // Reinstall all previously installed features, except // disk1 features. FeatureUpdate( "" ); else // Reinstall all previously installed features. FeatureReinstall(); endif; // Added in 11.0 - Set appropriate StatusEx static text. SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REPAIR ) ); case MODIFY: // Added in 11.0 - Set appropriate StatusEx static text. SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_MODIFY ) ); endswitch; end;