5

cmdコンソールで次のように実行される.exeファイルを実行してみてください。

nameFile.exe-inffileDriver.infインストール

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ファイルを実行するにはどうすればよいですか?

4

1 に答える 1

4

呼び出しを見てExec、コマンドパラメーターを関数呼び出しの2番目のパラメーターに渡す必要があります。代わりに次のようなものを使用してみてください。

...
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;
于 2013-01-26T23:31:14.777 に答える