在WiX卸载中停止显示自定义对话框

编程入门 行业动态 更新时间:2024-10-28 04:19:50
本文介绍了在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属性的完整列表和简要说明,请参见: msdn.microsoft/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: msdn.microsoft/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 适当地调节对话框的显示来解决此问题: msdn.microsoft/zh-CN/library/aa372096(VS.85).aspx .只是为了使事情变得有趣和令人困惑,Microsoft在安装过程中定义了4个级别的GUI,从完全静默到各种选项(例如仅进度条等),请参见链接.

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: msdn.microsoft/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卸载中停止显示自定义对话框

本文发布于:2023-08-02 17:12:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   对话框   WiX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!