请尝试运行cmd控制台中运行的.exe文件,方法如下: nameFile.exe -inf fileDriver.inf install 在Inno Setup中我有以下内容: varcommand: Srtring;Begincommand := 'nameFile.exe -inf fileDriver.inf install';command := AddQu
nameFile.exe -inf fileDriver.inf install
在Inno Setup中我有以下内容:
var command: Srtring; Begin command := 'nameFile.exe -inf fileDriver.inf install'; command := AddQuotes(command); Exec(command, '', 'C:\pathOfFileName', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); S:= SysErrorMessage(ResultCode); MsgBox(S, mbInformation, MB_OK); end;
消息显示参数无效,如何用参数运行exe文件?
查看Exec
调用,需要将命令参数传递给函数调用的第二个参数.尝试使用类似的东西:
... Exec('nameFile.exe', '-inf fileDriver.inf install', 'C:\pathOfFileName', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); ...
Exec
函数声明为:
function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;