Inno Setup:安装回滚时控件消失(安装程序冻结)

Inno Setup: Controls disappear (installer freezes) while installation is rolling back

当我确认取消安装程序时,Inno Setup 会终止或隐藏一些常用和自定义控件(标签、单选按钮等)。是否可以在 WizardForm 存在期间保持它们可见?

我使用 VCL Inno Styler 自定义 window 并控制样式:

这是日志文件的内容:

 2016-05-16 13:50:01.225   Message box (Yes/No): Are you sure you want to close the installer? You won't be able to recover the data.
 2016-05-16 13:50:02.322   User chose Yes.
 2016-05-16 13:50:02.404   User canceled the installation process.
 2016-05-16 13:50:02.404   Rolling back changes.
 2016-05-16 13:50:02.408   Starting the uninstallation process.
 2016-05-16 13:50:02.408   Uninstallation process succeeded.
 2016-05-16 13:50:03.916   Deinitializing Setup.
 2016-05-16 13:50:11.176   Failed to remove temporary directory: C:\Users\AATASH~1\AppData\Local\Temp\is-N7DAL.tmp

Inno Setup 中的 "rollback" 实现远非完美。

Inno 安装程序在卸载期间不处理 window 消息队列。它甚至明确地冻结了 1500 毫秒,"so that the user has time to read the "回滚更改”消息“.

由于消息队列未被抽取,因此在 Windows 中,一些控件(尤其是高级控件)消失是很常见的,因为它们不处理 "draw" 请求。由于您无法让 Inno Setup 处理队列,因此您实际上无能为力。

部分解决方案:

  • 自己隐藏高级控件并重新显示 WizardForm.StatusLabel(显示 "Rolling back changes..." 消息)。 "labels" 在消息队列未被抽取时不会消失。
  • 使用 WizardForm.Hide.
  • 取消安装程序时隐藏整个 window