[英]How run .exe file in Inno Setup with parameters
Please, I try run a .exe file that in cmd console runs in the following manner: 请尝试运行cmd控制台中运行的.exe文件,方法如下:
nameFile.exe -inf fileDriver.inf install nameFile.exe -inf fileDriver.inf install
In the Inno Setup i have the follow: 在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;
The message show that the parameters is invalid, how can run the exe file with the parameters? 消息显示参数无效,如何用参数运行exe文件?
Looking at your Exec
call, you need to pass the command parameters to the second parameter of the function call. 查看Exec
调用,需要将命令参数传递给函数调用的第二个参数。 Try to use something like this instead: 尝试使用类似的东西:
...
Exec('nameFile.exe', '-inf fileDriver.inf install', 'C:\pathOfFileName',
SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
...
The Exec
function is declared as: 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.