MSI 安装:取消不起作用

发布于 2024-11-18 18:11:30 字数 206 浏览 1 评论 0原文

默认安装程序 UI 中的“取消”按钮到底如何工作?

如果我单击“取消”按钮,有时我可以看到“您要取消设置吗”对话框,其中包含是或否选项。

但某些情况下,此弹出窗口不会显示,安装会继续。

如果我仅在第一阶段结束时单击取消按钮,我就会看到这个问题。状态消息是“正在处理新文件”。

“处理新文件”是延迟操作。为什么第一阶段就显示这个消息?

How exactly CANCEL button works in default installer UI?

If i click CANCEL button, some times i can able to see "do you want cancel setup" dialog box with yes or no options.

But some cases, this popup won't show up and installation continues.

I am seeing this problem, if i click CANCEL button at the end of first phase only. status message is "Coping new files".

"Coping new files" is deferred action. How come this message is showing in first phase?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

方圜几里 2024-11-25 18:11:30

您确定它实际上正在运行“复制新文件”操作,还是在该操作之后不发布任何进度更新?如果它是自定义操作,请注意它执行以下两件事之一:

  • 从不调用 MsiProcessMessage(或等效项)
  • 注意 MsiProcessMessage 的返回代码并适当处理取消

如果该操作从不调用 MsiProcessMessage,则 Windows Installer 将处理取消动作,但无法在动作中取消。如果该操作调用 MsiProcessMessage(具有 eMessageType 的特定值),则 Windows Installer 会假定该操作将处理取消,并且该操作必须返回 ERROR_INSTALL_USEREXIT,否则 Windows Installer 会感到困惑。

Are you sure it's actually running the "Copying new files" action, or is it an action after that which doesn't post any progress updates? If it's a custom action, be careful that it does one of two things:

  • Never calls MsiProcessMessage (or equivalent)
  • Pays attention to the return codes of MsiProcessMessage and handles cancel appropriately

If the action never calls MsiProcessMessage, then Windows Installer will handle cancel for the action, but cannot cancel it in the middle of the action. If the action calls MsiProcessMessage (with certain values for eMessageType), then Windows Installer assumes that the action will process the cancel, and the action must return ERROR_INSTALL_USEREXIT or Windows Installer gets confused.

等往事风中吹 2024-11-25 18:11:30

默认安装程序 UI 中的“取消”按钮到底如何工作?他们使用多线程,例如 WindowsForms .NET 中的 BackgroundWorker。一个线程用于 UI,一个线程用于安装,如果您单击取消(UI),它将尝试在某个时间点停止另一个线程(安装)。

How exactly CANCEL button works in default installer UI? They are using multiple threads like BackgroundWorker in WindowsForms .NET. One thread for the UI and one for the installation, if you click cancel(UI), it will try to stop the other thread(installation) AT A CERTAIN POINT IN TIME.

西瑶 2024-11-25 18:11:30

MSI 安装过程的执行顺序分两个阶段运行:

  1. 首先,应执行的所有操作都写入临时安装脚本中。这是立即的,并且总是显示取消弹出窗口。
  2. 第二阶段运行该脚本并实际执行安装。它以延迟方式运行。根据您按下取消的确切时间,可能会或可能不会显示弹出窗口。

例如,当提交操作开始执行时,无法再取消安装。

The execute sequence of an MSI installation process runs in two phases:

  1. First all actions which should be executed are written in a temporary installation script. This is immediate and it always shows the cancel popup.
  2. The second phase runs that script and actually performs the installation. It runs as deferred. Depending on when exactly you press cancel, the popup may or may not be shown.

For example, the installation can no longer be canceled when commit actions start executing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文