zoukankan      html  css  js  c++  java
  • IS---InstallShield第二天

    在Setup.rul中,新增OnBegin函数


    STRING str1,spath,szApplicationPath,szApplicationCmdLine,szCmdLine;
    function OnBegin()    
    begin
        // TO DO: you may change default non-UI setting, for example
        //
        // You may also perform your custom initialization steps, check requirements, etc.  
        Disable(BACKBUTTON);
        if(!MAINTENANCE)then
        SdLicense2("License","","",SUPPORTDIR^"协议.txt",FALSE);
        endif;         

        //------------------------------------------------------------------------------------
        szApplicationPath = WINSYSDIR ^ "msiexec.exe";
        szApplicationCmdLine = "/i c:\mysql.msi";
        LongPathToQuote( szApplicationPath, TRUE );
        szCmdLine = szApplicationPath + " " + szApplicationCmdLine;

        RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
        MessageBox ("You are here", INFORMATION);
    if(RegDBKeyExist("SOFTWARE\MySQL AB\MySQL Connector/ODBC 5.2 64bit(community edition)")<0)then    
        MessageBox ("You are here1", INFORMATION);
        MessageBox(PROGRAM,INFORMATION);  
        MessageBox(SRCDIR,INFORMATION);  
        MessageBox(szCmdLine,INFORMATION);
        LaunchAppAndWait("",szCmdLine, LAAW_OPTION_WAIT);
    endif;


    end;功能:在安装时,出现许可证后检测是否系统中安装必要的组件,如果没有安装就提示安装。有,则跳过。当必要组件是.exe的文件。直接加载到support中即可。如果是.msi后缀的文件需要调用window installer来安装。用到的函数是LaunchAppAndWait(szProgram, szCmdLine, nOptions )


    szProgram:Specifies the complete path and file name of the application to be launched.

    szCmdLine:Specifies the command-line parameters to pass to the launched application.

    nOptions:LAAW_OPTION_WAIT----Passed through the function to WaitForApplication.

     

  • 相关阅读:
    linux 软件多版本共存
    git new
    centos 7 重新设置分区大小
    yum 多线程插件,apt多线程插件
    配置opencv cmake
    cmake 配置
    OpenCV 静态库 CMAKE 文件
    cron
    开课啦
    pytorch转onnx问题
  • 原文地址:https://www.cnblogs.com/cq351266168/p/3644114.html
Copyright © 2011-2022 走看看