Is it possible to repeat an .exe file after an termination. So when you terminate a running executable program (from Run section), because an error code appears, and then you want to execute the same program again (something like a loop).
Is it possible to repeat an .exe file after an termination. So when you terminate a running executable program (from Run section), because an error code appears, and then you want to execute the same program again (something like a loop).
I do not think that it's possible in the Run section. Except that you may be able to do a limited number of retries, based on a non-zero exit code using cmd || operator:
[Run]
Filename: {cmd}; Parameters: "/c command params || command params || ..."
If you need better control, you should use Exec function from CurStepChanged event function in ssInstall or ssPostInstall step, like:
procedure CurStepChanged(CurStep: TSetupStep);
var
Code: Integer;
begin
if CurPageID = ssPostInstall then
begin
while (not Exec('command', 'params', '', SW_HIDE, ewWaitUntilTerminated, Code)) or
(Code <> 0) do ;
end;
end;