Parameters 如何使用参数在Inno安装程序中运行.exe文件

Parameters 如何使用参数在Inno安装程序中运行.exe文件,parameters,executable,exe,inno-setup,Parameters,Executable,Exe,Inno Setup,请,我尝试运行一个.exe文件,该文件在cmd控制台中以以下方式运行: nameFile.exe-inf fileDriver.inf安装 在Inno设置中,我有以下内容: var command: Srtring; Begin command := 'nameFile.exe -inf fileDriver.inf install'; command := AddQuotes(command); Exec(command, '', 'C:\pathOfFileName', SW_SHOWN

请,我尝试运行一个.exe文件,该文件在cmd控制台中以以下方式运行:

nameFile.exe-inf fileDriver.inf安装

在Inno设置中,我有以下内容:

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('nameFile.exe', '-inf fileDriver.inf install', 'C:\pathOfFileName', 
      SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
...
该函数声明为:

function Exec(const Filename, Params, WorkingDir: String; 
  const ShowCmd: Integer; const Wait: TExecWait; 
  var ResultCode: Integer): Boolean;

该死!用大约10次按键和鼠标点击击败我!:-)+1我必须用我写的至少一部分内容做点什么。;-)不客气。谢谢,但我将'-inf fileDriver.inf安装'-inf fileDriver.inf安装'-inf fileDriver.inf并开始工作…=)谢谢你纠正我!我很早以前就用过
Exec
,并且是从头开始写的。