//===========================================================================
//
//  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  nsql,nfrm,nResult, nLevel, nSize, nSetupType;
    string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
    string  szName, szCompany, szTargetPath, szDir, szFeatures; 
    string  szCP,szliang;
    LIST   listDetails, listTopics;
    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_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_Start;
    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;  
    szCP = ""; 
    nsql = 0;
    nfrm = 0;
    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;   
   
    szMsg = "Next system will be installed \n SQLServer2005 \n Microsoft .NET Framework 2.0";   
   
    nResult = SdWelcome( szTitle, szMsg );
   
     
    //szTitle = "";
    //szliang = "Next system will be installed ";
 // szMsg = "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS";

    // RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

    // if (RegDBKeyExist (szMsg) < 0) then
    //     nsql = 2;
    //     szliang = szliang + "\n SQLServer2005 ";
    // endif;
        
   // nResult = SdWelcome( szTitle, szliang );
 
   // if (nsql > 1 ) then
     szCP =  SUPPORTDIR ^ "SQLServer2005.exe";
     if (LaunchAppAndWait (szCP, "", WAIT) < 0) then
         MessageBox ("Can not load procedures "+ szCP +".",SEVERE);
     endif;
    //endif;
        
    szCP =  SUPPORTDIR ^ "dotnetfx.exe";
    if (LaunchAppAndWait (szCP, "", WAIT) < 0) then
       MessageBox ("Can not load procedures "+ szCP +".",SEVERE);
    endif; 
     
    //szMsg = "Next system will be installed \n SQLServer2005 \n Microsoft .NET Framework 2.0";   
   
    //nResult = SdWelcome( szTitle, szMsg );
   // if (nResult = BACK) goto Dlg_SdAskDestPath2; 
   // szCP   =   "/i   " +  SUPPORTDIR^"msxml6.msi"; 
   // if (LaunchAppAndWait ("msiexec.exe",szCP,  WAIT) < 0) then
   //    MessageBox ("Can not load procedures "+ szCP +".",SEVERE);
   // endif;

 
     
    //nResult = SdWelcome( szTitle, szMsg );
    //if (nResult = BACK) goto Dlg_SdAskDestPath2; 
   // szCP   =   "/i   " +  SUPPORTDIR^"SQLServer2005.msi"; 
   // if (LaunchAppAndWait ("msiexec.exe",szCP,  WAIT) < 0) then
   //    MessageBox ("Can not load procedures "+ szCP +".",SEVERE);
  //  endif;
       
 
   

Dlg_SQLServer:
    nResult = OnSQLServerInitialize( nResult );
    if( nResult = BACK ) goto Dlg_SdFeatureTree;

Dlg_ObjDialogs:
    nResult = ShowObjWizardPages( nResult );
    if (nResult = BACK) goto Dlg_SQLServer;

Dlg_ValueAddedServices:
    nResult = OnFirstUIBeforeValueAddedServices( nResult );
    if (nResult = BACK) goto Dlg_ObjDialogs;
   
Dlg_SdStartCopy2:
    szTitle = "";
    szMsg = "";
    //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2) 
    nResult = SdStartCopy2( szTitle, szMsg ); 
    //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2)
    if (nResult = BACK) goto Dlg_ValueAddedServices;  
  
    // Added in 11.0 - Set appropriate StatusEx static text.
    SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) );
   return 0;    

end;

 
function OnMoved() 
    number  nResult, nLevel, nSize, nSetupType;
    string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
    string  szName, szCompany, szTargetPath, szDir, szFeatures; 
    string  szCP;     
begin

 Dlg_SdWelcome:
    szTitle = "";
    //szMsg = "";
    szMsg = "Next system will be installed CP210xVCPInstaller";
    //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
    nResult = SdWelcome( szTitle, szMsg );
    //}}IS_SCRIPT_TAG(Dlg_SdWelcome)
    if (nResult = BACK) goto Dlg_SdWelcome;
   
    szCP =  TARGETDIR ^ "ForeignTrade\\CP210x\\CP210xVCPInstaller.exe";
    if (LaunchAppAndWait (szCP, "", WAIT) < 0) then
       MessageBox ("Can not load procedures "+ szCP +".",SEVERE);
    endif; 
end;

posted on 2008-06-19 08:54  Liangyy  阅读(1485)  评论(0编辑  收藏  举报