Please, I try run a .exe file that in cmd console runs in the following manner:
nameFile.exe -inf fileDriver.inf install
In the Inno Setup i have the follow:
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?
Looking at your Exec
call, you need to pass the command parameters to the second parameter of the function call. 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:
function Exec(const Filename, Params, WorkingDir: String;
const ShowCmd: Integer; const Wait: TExecWait;
var ResultCode: Integer): Boolean;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With