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.

     

  • 相关阅读:
    Requests发送带cookies请求
    Python3 + requests + unittest接口测试
    「完结篇」网络爬虫+实时监控+推送微信
    「爬虫」从某网站爬取数据
    定时从某网站爬取压缩包
    如何转载文章...............
    数据库连接远程服务器报错
    记录常用的Java方法
    链接服务器 不同服务器查询,插入数据
    【学习笔记】树状数组
  • 原文地址:https://www.cnblogs.com/cq351266168/p/3644114.html
Copyright © 2011-2022 走看看