I try to execute an .exe in the CurStepChanged
procedure at (CurrentStep = ssPostInstall)
, the .exe is part of the [Files]
section. It seems to me as if the ssPostInstall
is executed multiple times – sometimes even before the files of the installation process are processed. Of course I could extract the .exe to a temporary folder but as I would like to understand the behavior it’s disappointing. The moment when the ssPostinstall
step is reached seems to vary every time I execute and sometimes is reached more than one time. Am I missing something? Here is a part of my code:
procedure CurStepChanged(CurrentStep: TSetupStep);
var ErrorCode : Integer;
begin
if (CurrentStep = ssPostInstall) then begin
if Exec(ExpandConstant('{app}\{code:getVersionSubdir}\licencing\haspdinst.exe'), '-i', '',SW_SHOW, ewWaitUntilTerminated, ErrorCode) then
begin
if ErrorCode = 0 then else
MsgBox(SysErrorMessage(ErrorCode), mbCriticalError, MB_OK);
end;
end
else begin
MsgBox('Did not work', mbCriticalError, MB_OK);
end;
end;
Thanks in advance
Chris