I don't know why they blocked it:
"procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssDone then
begin
if not FileCopy(ExpandConstant('{srcexe}), ExpandConstant('{app}\setup.exe'), false) then
begin
MsgBox('could not clone setup', mbInformation, MB_OK);
end;
end;
end;"
But this one also is not possible:
function InitializeSetup(): Boolean;
Var
ResultCode: Integer;
begin
if not Exec(ExpandConstant('{srcexe}'), '/?', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('could not re-execute setup', mbInformation, MB_OK);
end;
end;
So, for now use WinAPI function. I am also curious what Martijn write about that?