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

感情迁移 提交于 2020-05-12 09:05:13

问题


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


回答1:


You can monitor the CurStepChanged. If the last step ever started is the ssInstall and you never get to the ssPostInstall, let only 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;


来源:https://stackoverflow.com/questions/40982671/inno-setup-how-to-display-a-message-after-installation-is-cancelled

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!