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.

     

  • 相关阅读:
    命令拷屏之网络工具
    PHP 设计模式 笔记与总结(1)命名空间 与 类的自动载入
    Java实现 计蒜客 1251 仙岛求药
    Java实现 计蒜客 1251 仙岛求药
    Java实现 计蒜客 1251 仙岛求药
    Java实现 蓝桥杯 算法训练 字符串合并
    Java实现 蓝桥杯 算法训练 字符串合并
    Java实现 蓝桥杯 算法训练 字符串合并
    Java实现 LeetCode 143 重排链表
    Java实现 LeetCode 143 重排链表
  • 原文地址:https://www.cnblogs.com/cq351266168/p/3644114.html
Copyright © 2011-2022 走看看