如题,如何在installshield 某个情况下能够执行.bat。
有例子较好。

解决方案 »

  1.   

    看看帮助文档
    语法: 
    function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean; 描述: 
    执行指定的可执行文件。使用 Wait 指定 InstExec 是否应该立即返回或等待,直到可执行文件终止或空闲。如果指定的文件已执行则返回 True,否则返回 False。如果返回 True 并且 Wait 是 WaitUntilTerminated,那么 ResultCode 返回执行的文件的退出代码。如果返回 False,那么 ResultCode 指定遇到的错误。使用 SysErrorMessage(ResultCode) 获取错误描述。注释: 
    TExecWait 定义为:TExecWait = (ewNoWait, ewWaitUntilTerminated, ewWaitUntilIdle); 如果你需要运行一个不是可执行文件或批处理文件,则用 ShellExec 函数替换。不要在文件名参数中包含引号,该函数将自动添加。
      

  2.   

    不是D 环境下的执行.BAT我要的是在使用打包工具installshield时 来执行.bat
      

  3.   

    看错了不好意思 我以为是Inno Setup打包
      

  4.   

    http://www.cnblogs.com/solo/archive/2007/08/11/851888.html
    sMsg="Excute Configure file and SQL.";
    SdShowMsg (sMsg, TRUE);
    result = result + LaunchAppAndWait(INSTALLDIR^"Component\\config.bat","",LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
    sCmdLine= sServerName+" \""+ sUserName+"\" \""+ sPWD+ "\""; 
    result = result + LaunchAppAndWait(INSTALLDIR^"Component\\setup2.bat",sCmdLine,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN); 
    SdShowMsg (sMsg, FALSE);