Nico Z
Nico Z

Reputation: 1037

Inno Setup - How to display a message after installation is cancelled

How to display a message after an installation is completely cancelled?

Upvotes: 1

Views: 1640

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202682

You can monitor the CurStepChanged. If the last step ever started is the ssInstall and you never get to the ssPostInstall, let alone ssDone, the installation was most probably aborted. In that case, display the message in the DeinitializeSetup event function.

[Code]

var
  LastStep: TSetupStep;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  Log(Format('Step: %d', [CurStep]));
  LastStep := CurStep;
end;

procedure DeinitializeSetup();
begin
  { Installation started, but never finished => It must have been cancelled. } 
  if LastStep = ssInstall then
  begin
    MsgBox('The installation was successfully aborted.', mbInformation, MB_OK);
  end;
end;

Upvotes: 2

Related Questions