123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- //===========================================================================
- //
- // 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"
- #include "IpAddress.rul"
- #include "featureevents.rul"
- //---------------------------------------------------------------------------
- // 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
-
- 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_SdLicense2:
- szTitle = "";
- szOpt1 = "";
- szOpt2 = "";
- //{{IS_SCRIPT_TAG(License_File_Path)
- szLicenseFile = SUPPORTDIR ^ "License.rtf";
- //}}IS_SCRIPT_TAG(License_File_Path)
- //{{IS_SCRIPT_TAG(Dlg_SdLicense2)
- // nResult = SdLicense2Rtf( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted );
- //}}IS_SCRIPT_TAG(Dlg_SdLicense2)
- if (nResult = BACK) then
- goto Dlg_SdWelcome;
- else
- bLicenseAccepted = TRUE;
- endif;
- Dlg_SdRegisterUser:
- szMsg = "";
- szTitle = "";
- //{{IS_SCRIPT_TAG(Dlg_SdRegisterUser)
- // nResult = SdRegisterUser( szTitle, szMsg, szName, szCompany );
- //}}IS_SCRIPT_TAG(Dlg_SdRegisterUser)
- if (nResult = BACK) goto Dlg_SdLicense2;
- Dlg_SetupType2:
- szTitle = "";
- szMsg = "";
- nResult = CUSTOM;
- //{{IS_SCRIPT_TAG(Dlg_SetupType2)
- nResult = SetupType2( szTitle, szMsg, "", nSetupType, 0 );
- //}}IS_SCRIPT_TAG(Dlg_SetupType2)
- if (nResult = BACK) then
- goto Dlg_SdRegisterUser;
- else
- nSetupType = nResult;
- if (nSetupType != CUSTOM) then
- szTargetPath = TARGETDIR;
- nSize = 0;
- FeatureCompareSizeRequired( MEDIA, szTargetPath, nSize );
- if (nSize != 0) then
- MessageBox( szSdStr_NotEnoughSpace, WARNING );
- goto Dlg_SetupType2;
- endif;
- endif;
- endif;
- Dlg_SdAskDestPath2:
- if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
- 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_SetupType2;
- Dlg_SdFeatureTree:
- if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdAskDestPath2;
- szTitle = "";
- szMsg = "";
- szFeatures = "";
- nLevel = 2;
- if (nSetupType = CUSTOM) then
- //{{IS_SCRIPT_TAG(Dlg_SdFeatureTree)
- nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, szFeatures, nLevel );
- //}}IS_SCRIPT_TAG(Dlg_SdFeatureTree)
- if (nResult = BACK) goto Dlg_SdAskDestPath2;
- endif;
- Dlg_SQLServer:
- nResult = OnSQLServerInitialize( nResult );
- if( nResult = BACK ) goto Dlg_SdFeatureTree;
- Dlg_ObjDialogs:
- nResult = ShowObjWizardPages( nResult );
- if (nResult = BACK) goto Dlg_SQLServer;
-
- Dlg_SdStartCopy2:
- szTitle = "";
- szMsg = "";
- //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2)
- nResult = SdStartCopy2( szTitle, szMsg );
- //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2)
- if (nResult = BACK) goto Dlg_ObjDialogs;
- // Added in 11.0 - Set appropriate StatusEx static text.
- SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) );
-
- return 0;
- end;
- //---------------------------------------------------------------------------
- // OnSetTARGETDIR
- //
- // OnSetTARGETDIR is called directly by the framework to initialize
- // TARGETDIR to it's default value.
- //
- // Note: This event is called for all setups.
- //---------------------------------------------------------------------------
- function OnSetTARGETDIR()
- number nId, nIgnore, nResult;
- string szId, szTARGETDIR;
- string svCurrentDir; // 默认的安装目录;
- begin
- // In maintenance mode the value of TARGETDIR is read from the log file.
- if( MAINTENANCE ) then
- return ISERR_SUCCESS;
- endif;
-
- fGetIpAddress(szId, svCurrentDir);
-
- // 重新定义安装的默认目录;
- GetCurrentDir( svCurrentDir );
- // 获取字段串长度;
- nId = StrLength(svCurrentDir);
- // 获取路径最后一个字符;
- StrSub(szId, svCurrentDir,nId - 1, nId);
- // 判断最后一个字符是否为"\\";
- if (szId == "\\") then
- TARGETDIR = svCurrentDir + "<IFX_COMPANY_NAME>\\<IFX_PRODUCT_NAME>";
- else
- TARGETDIR = svCurrentDir + "\\<IFX_COMPANY_NAME>\\<IFX_PRODUCT_NAME>";
- endif;
- // Read TARGETDIR from the media.
- nResult = MediaGetData( MEDIA, MEDIA_FIELD_TARGETDIR, nIgnore, szTARGETDIR );
-
- // Customize the default TARGETDIR for multi-instance application.
- // TODO: If you want something different customize the code below.
- if( MAINT_OPTION = MAINT_OPTION_MULTI_INSTANCE && MULTI_INSTANCE_COUNT > 0) then
- // Start with the current multi-instance count plus one.
- nId = MULTI_INSTANCE_COUNT + 1;
- // Find a unique TARGETDIR.
- while( ExistsDir( TARGETDIR ) = EXISTS )
-
- // Convert to string.
- NumToStr( szId, nId );
-
- // Update IFX_MULTI_INSTANCE_SUFFIX
- IFX_MULTI_INSTANCE_SUFFIX = "_" + szId;
-
- // Update TARGETDIR
- TARGETDIR = TARGETDIR + IFX_MULTI_INSTANCE_SUFFIX;
-
- // Update nId
- nId = nId + 1;
- endwhile;
- endif;
- end;
|