简体   繁体   English

取消InnoSetup安装程序

[英]Cancelling an InnoSetup installer

Situation 情况

During the installation of our product I detect if our programs are still running (from a previous installation) by using CheckForMutexes. 在安装产品的过程中,我使用CheckForMutexes检测程序是否仍在运行(从先前的安装)。 If our programs are still running I pop up a message box (by using MsgBox) that tells the user to close the programs. 如果我们的程序仍在运行,我会弹出一个消息框(使用MsgBox),告诉用户关闭程序。 If the user clicks the ok and they haven't closed our programs, the same message box is displayed. 如果用户单击“确定”并且尚未关闭我们的程序,则会显示相同的消息框。 I'd like to display a cancel button in the MsgBox that aborts the installation, which would be desired in the case the user doesn't want to close the running programs. 我想在MsgBox中显示一个取消按钮来中止安装,这在用户不想关闭正在运行的程序的情况下是需要的。

Question

How can I abort an InnoSetup install programmatically? 如何以编程方式中止InnoSetup安装?

Thanks in advance 提前致谢

Take a look at InitializeSetup and Abort in the Inno Setup help. 查看Inno Setup帮助中的InitializeSetupAbort The Abort function will allow the setup to exit. Abort功能将使设置退出。

Call the WizardForm.Close() method. 调用WizardForm.Close()方法。

It will prompt the user if she really wants to cancel the installation. 它将提示用户是否真的要取消安装。

procedure ExitSetup;
begin
  WizardForm.Close;
end;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM