MSI 安装:取消不起作用
默认安装程序 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您确定它实际上正在运行“复制新文件”操作,还是在该操作之后不发布任何进度更新?如果它是自定义操作,请注意它执行以下两件事之一:
如果该操作从不调用 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:
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 returnERROR_INSTALL_USEREXIT
or Windows Installer gets confused.默认安装程序 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.
MSI 安装过程的执行顺序分两个阶段运行:
例如,当提交操作开始执行时,无法再取消安装。
The execute sequence of an MSI installation process runs in two phases:
For example, the installation can no longer be canceled when commit actions start executing.