在WiX卸载中停止显示自定义对话框 [英] Stopping display of custom dialog boxes in WiX uninstall

查看:87
本文介绍了在WiX卸载中停止显示自定义对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WiX安装程序项目,该项目利用自定义对话框询问参数以更新web.config文件并在安装时运行数据库脚本.一切正常,应用程序已安装并正常运行.

I have a WiX installer project that utilises a custom dialog box to ask for parameters to update a web.config file and run a database script on install. Everything works correctly and the application is installed and runs correctly.

但是,自定义对话框在我卸载软件时也会显示,并且肯定不需要(因为我没有更新web.config文件).

However, the custom dialog box is also displayed when I uninstall the software and it certainly doesn't need to be (as I'm not updating a web.config file).

在卸载应用程序时,是否有一种方法可以禁止显示自定义对话框?

Is there a way to suppress the custom dialog when the application is being uninstalled?

(我还应该在卸载时删除我安装的sql proc,但这不在此问题范围内.)

(I should also remove the sql procs I install, at uninstall time but that is outside of this issue).

推荐答案

您的问题的解决方案是使用条件( Not REMOVE ="ALL" )对自定义操作进行条件化.这将使操作在全新安装和维护安装上运行,而不是在卸载上运行.如果不需要在维护安装上运行,而仅在全新安装上运行,则可以将条件设​​置为:(未安装且未安装(REMOVE ="ALL" )). MSI属性的完整列表和简要说明,请参见: http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx .

The solution to your question is to condition the custom action with the condition (Not REMOVE="ALL"). This will make the action run on fresh install and maintenance install, but not on uninstall. If you don't need to run on maintenance install, but only on a fresh install you can set the condition to be: (Not Installed AND Not(REMOVE="ALL")). Full list of MSI properties and brief descriptions here: http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx.

MSI文件中的排序和自定义操作逻辑非常复杂.尽一切可能避免采取自定义操作确实很有意义.

The sequencing and custom action logic in MSI files is VERY complicated. It really pays off to avoid custom actions whenever you can.

还有更多-所有MSI文件都内置了对静默安装的支持.这意味着可以跳过整个GUI序列,并且无需用户交互即可安装MSI文件.这是通过SMS/SCCM或其他部署机制进行公司部署的关键功能.在静默模式下运行安装程序时显示自定义对话框违反了此基本MSI功能.您可以通过根据属性 UILevel 适当地调节对话框的显示来解决此问题:

There is more - all MSI files have built-in support for silent installation. This means that the entire GUI sequence can be skipped, and the MSI file installed without user interaction. This is a crucial feature for corporate deployment via SMS / SCCM or other deployment mechanisms. Showing a custom dialog box when the setup is run in silent mode is a violation of this basic MSI feature. You can work around this by properly conditioning the display of the dialog based on the property UILevel: http://msdn.microsoft.com/en-us/library/aa372096(VS.85).aspx. Just to keep things interesting and confusing Microsoft has defined 4 levels of GUI during an installation ranging from completely silent, through various options such as progress bar only etc... See the link for details.

我可以在此处添加有关MSI序列,条件,自定义操作等的许多详细信息,但它无法回答您的问题.请添加任何后续问题.

I could add a lot of details here about MSI sequences, conditions, custom actions and similar, but it wouldn't answer your question. Please add any follow-up questions.

这篇关于在WiX卸载中停止显示自定义对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆