Inno Setup - 取消安装后如何显示消息

时间:2016-12-05 20:23:20

标签: inno-setup

如何在完全取消安装后显示消息?

1 个答案:

答案 0 :(得分:2)

您可以监控CurStepChanged。如果最后一步是ssInstall而你永远不会进入ssPostInstall,只允许ssDone,安装很可能会中止。在这种情况下,请在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;