首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Installshield 装配一

2013-11-06 
Installshield 安装一////

Installshield 安装一
//===========================================================================
//
//  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.
//---------------------------------------------------------------------------

#define BITMAP_FILE SUPPORTDIR ^ "test.bmp"

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 = "安装程序即将在本机上安装咪嘻吧餐饮管理系统,确定是否继续安装?继续请按【下一步(next)】";
    //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
    nResult = SdWelcome( szTitle, szMsg );
    //}}IS_SCRIPT_TAG(Dlg_SdWelcome)
    if (nResult = BACK) goto Dlg_Start;

Dlg_SdBitmap:
szTitle = "咪嘻吧餐饮管理系统";
nResult = SdBitmap( szTitle, "" ,BITMAP_FILE);
if (nResult = BACK) goto Dlg_SdWelcome;



Dlg_SdAskDestPath2:
    if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdBitmap;
szTitle = "咪嘻吧餐饮管理系统";
    szMsg = "安装目录选择";
    if (SdAskDestPath2 (szTitle, "", szDir ) = NEXT) then
      TARGETDIR = szDir;
   endif;
   //SprintfBox (INFORMATION, "SdAskDestPath2", "Successful.\n\nThe Target " +
               //"directory is: " + TARGETDIR);
    if (nResult = BACK) goto Dlg_SdBitmap;



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

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;







//---------------------------------------------------------------------------
// OnBegin
//
// The OnBegin event is called directly by the framework after the setup
// initializes. Note that this event will be called AFTER "Initialization"
// events (i.e.) OnSetTARGETDIR, OnCheckMediaPassword.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------
function OnBegin()  //程序开始时执行
string     szInfoString;
begin
     //增加背景图片
    //szInfoString = SUPPORTDIR ^ "bbrd8.bmp" ;
    //DialogSetInfo ( DLG_INFO_ALTIMAGE , szInfoString , TRUE);
   
    //设置安装程序时的桌面背景
    //Enable( BACKGROUND );
   // Enable(FULLWINDOWMODE); 
    //PlaceBitmap(SUPPORTDIR ^ "bbrd7.bmp",13,0,0,FULLSCREENSIZE);  
    //SetDisplayEffect(EFF_FADE)
    //PlaceBitmap(szInfoString,12,10,10,UPPER_LEFT);
end;
//---------------------------------------------------------------------------
// OnEnd
//
// The OnEnd event is called at the end of the setup. This event is not
// called if the setup is aborted.
//---------------------------------------------------------------------------

function OnFirstUIAfter()

    // local variables
NUMBER  nResult;
string szProgram,mysqlIniPath,szSectionName, szOrigValue, szReplaceValue;

STRING catalina_home;
STRING java_home;
STRING class_path;
STRING szKey; 
STRING szEnv;
STRING zspath,oriPath; 
NUMBER pEnv,nvSize,nvType;
 
begin

//修改mysql data的路径

mysqlIniPath = TARGETDIR ^ "\\mysql\\my.ini";




catalina_home=TARGETDIR ^ "tomcat";  
   java_home=TARGETDIR ^ "jdk";
   class_path=".;%JAVA_HOME%\\lib\\dt.jar;%JAVA_HOME%\\lib\\tools.jar;";
    
   szKey="SYSTEM\\ControlSet001\\Control\\Session Manager\\Environment";  
   RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);    
   RegDBSetKeyValueEx(szKey,"JAVA_HOME",REGDB_STRING,java_home,-1);  
   RegDBSetKeyValueEx(szKey,"CATALINA_HOME",REGDB_STRING,catalina_home,-1);
   RegDBSetKeyValueEx(szKey,"CLASSPATH",REGDB_STRING,class_path,-1);  
  
  
   RegDBGetKeyValueEx(szKey,"Path",nvType,oriPath,nvSize);
  
  
   zspath = oriPath+";%JAVA_HOME%\\bin;%JAVA_HOME%\\jre\\bin;"; 
   RegDBSetKeyValueEx(szKey,"PATH",REGDB_STRING,zspath,-1);  
  
  
   szEnv = "Environment";  
   pEnv = &szEnv;  
   SendMessage (0xffff, 0x001A , 0, pEnv );

szSectionName  = "mysqld";
    szOrigValue    = "F:/mixi8/mysql";
    szReplaceValue = TARGETDIR ^ "mysql";
    if (ReplaceProfString (mysqlIniPath, szSectionName, "basedir", szOrigValue,szReplaceValue) < 0) then
        MessageBox("Mysql ReplaceProfString failed.", SEVERE);
    endif;

    szOrigValue    = "F:/mixi8/mysql/data";
    szReplaceValue = TARGETDIR ^ "mysql\\data";
    if (ReplaceProfString (mysqlIniPath, szSectionName, "datadir", szOrigValue,szReplaceValue) < 0) then
        MessageBox("Mysql ReplaceProfString failed.", SEVERE);
    endif;
   

//nResult=ServiceAddService("mysqlcy","mysqlcy","mysqlcy",TARGETDIR^"\\mysql\\bin\\mysqld.exe",TRUE,"");  
szProgram = TARGETDIR ^ "\\mysql_installservice.bat"; 
    if (LaunchAppAndWait(szProgram, "", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN) < 0) then
           MessageBox ("mysqlcy register fail",SEVERE);
    endif;
   
szProgram = TARGETDIR ^ "\\apache_installservice.bat"; 
    if (LaunchAppAndWait(szProgram, "", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN) < 0) then
           MessageBox ("tomcat register fail",SEVERE);
    endif;
   
   
     LaunchAppAndWait ("net","start mysqlcy",WAIT );
   
    LaunchAppAndWait ("net","start tomcatcy",WAIT );


   
   
end;


//安装结束之前,设置java_home环境变量
function OnEnd()
 
begin 

  
end;

热点排行