![](/img/trans.png)
[英]How to pass parameter through “Run-->Parameters” in Inno Setup?
[英]How run .exe file in Inno Setup with parameters
請嘗試運行cmd控制台中運行的.exe文件,方法如下:
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;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.