将条目添加到MSI UpgradeTable中以删除相关产品 [英] Adding entries to MSI UpgradeTable to remove related products
问题描述
WiX安装程序产品节点具有属性 UpgradeCode .它用于指代同一产品的早期版本.该值存储在 UpgradeTable 中.升级表由 FindRelatedProducts 操作进行解析.
A WiX installer product node has an attribute UpgradeCode. It is used to refer to previous versions of the same product. The value is stored in the UpgradeTable. The UpgradeTable is parsed by the FindRelatedProducts action.
UpgradeCode
允许删除具有相同UpgradeCode
的先前产品.但是计划是将几个过时的旧产品集成到一个组合的产品中.此传统产品的UpgradeCode
是已知的.我希望将此代码添加到UpgardeTable中也可以删除该旧产品.这可以通过填写UpgradeTable来完成.
The UpgradeCode
allows to remove previous products with the same UpgradeCode
. But the plan is to integrate several outdated legacy product to a combined single product. The UpgradeCode
of this legacy product is known. I hope adding this code to the UpgardeTable will remove this legacy product too. this can be done by filling the UpgradeTable.
如何在WiX设置中的UpgradeTable中添加更多条目?
How can I add more entries in the UpgradeTable in a WiX setup?
需要什么语法?
是否有更好的方法来删除升级后已过时的产品?
Is there a better way to remove products that are absolete after an upgrade?
推荐答案
简短答案 :您添加了多个您的WiX中的升级元素 条目 源,它将在已编译的MSI的 升级中创建几行表 ,其中列出了在安装过程中要卸载的产品 安装(否则可能会中止安装).您必须非常小心为每个产品系列指定的卸载选项.
Short Answer: You add several Upgrade Element entries in your WiX source which will create several rows in the compiled MSI's Upgrade Table which then list products that are to be uninstalled during installation (or that can abort your installation). You must be very careful about the options you specify for each product family to uninstall.
并排安装 :请注意,在重大升级过程中卸载旧版本的另一种方法是使新版本足够独立,以便能够与现有安装共存.这种隔离可能是具有挑战性的,并且是另一种局面(预防:为文件关联而战,不兼容的COM服务器安装,不兼容的运行时,服务冲突,配置文件和注册表项的意外锁定等).
Side-By-Side Installations: Be aware that an alternative to uninstalling older versions during a major upgrade, is to make your new version isolated enough to be able to co-exist with existing installations. Such isolation can be challenging, and is a whole other ballgame (prevent: fighting over file associations, incompatible COM server installations, incompatible runtimes, conflicting services, unexpected locks of configuration files and registry keys, etc...).
主要升级元素 :较新版本的WiX具有
MajorUpgrade Element: Newer versions of WiX feature a "convenience feature" for major upgrade implementation in the form of the MajorUpgrade element. This elements simplifies the implementation of normal major upgrades.
升级元素 :在WiX的早期版本中,必须使用更多基本元素来实施重大升级.该元素仍然可用,这是您需要做得更细致和更细粒度的UpgradeTable配置所需要的.
Upgrade Element: In earlier versions of WiX more basic elements had to be used to implement major upgrades. This element is still available, and it is what you need to do more elaborate and fine-grained UpgradeTable configuration.
使用以下方法可以很好地说明使用这些方法之间的区别: Wim Coenen :
The differences between using these methods are very nicely illustrated by Wim Coenen here: Majorupgrade or Upgrade ID which is preferred for Major upgrade? I think that explanation is so good that I refuse to repeat it too much here :-). Give it a quick read please.
主要升级配置选项 :以下仅是示例.在每种情况下,都必须仔细考虑主要升级的实际配置:
Major Upgrade Configuration Choices: The below is just a sample. The actual configuration of a major upgrade has to be carefully reasoned in each case:
- 如果找到更高版本,是否要中止?
- 来自什么产品线?
- 错误消息是什么?
- Do you want to abort if higher versions are found?
- From what product line?
- What will the error message be?
您显然必须为此计划并进行详细测试.下面是一个模型.这结合了MajorUpgrade元素和Upgrade元素的使用.您还可以完全依靠升级元素以更精细的控制来手动"执行操作:
You obviously have to plan for this and test in detail. Below is a mock-up. This combines the use of the MajorUpgrade Element and Upgrade elements. You can also rely solely on Upgrade elements to do things "manually" with more fine grained control:
<!-- Major upgrade - Your New Product Line, using the MajorUpgrade convenience element --> <MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed" /> <!-- Older Product Line 1: Upgrade Code --> <Upgrade Id="{11111111-1111-1111-1111-000000000000}"> <UpgradeVersion Property="PRODUCTLINE1" IncludeMinimum="yes" Minimum="0.0.0" /> </Upgrade> <!-- Older Product Line 2: Upgrade Code --> <Upgrade Id="{22222222-2222-2222-2222-000000000000}"> <UpgradeVersion Property="PRODUCTLINE2" IncludeMinimum="yes" Minimum="0.0.0" /> </Upgrade> <!-- Older Product Line 3: Upgrade Code --> <Upgrade Id="{33333333-3333-3333-3333-000000000000}"> <UpgradeVersion Property="PRODUCTLINE3" IncludeMinimum="yes" Minimum="0.0.0" /> </Upgrade>
我建议您更改这些PRODUCTLINE属性的名称,这些属性固有地可以理解为特定产品系列.换句话说,如果您卸载WiX3,则将其命名为WIX3PRODUCTLINE等...这样可以更轻松地理解生成的日志文件.
I would suggest you change the name of these PRODUCTLINE properties that is inherently understandable as a specific product line. In other words if you uninstall WiX3 you call it WIX3PRODUCTLINE etc... This is so the resulting log file is easier to comprehend.
样品升级表 :
Sample Upgrade Table:
Attributes列 > 升级表 对于控制主要升级的行为很重要.继续执行卸载失败等操作... The Attributes column of the Upgrade Table is important to control the behavior of the major upgrade. Continue on uninstall failure, etc...
以及免费工具列表,可用于查看已编译的MSI文件(对于可能会找到此答案的人):
And a list of free tools you can use to view a compiled MSI files (for whoever might find this answer): How can I compare the content of two (or more) MSI files?
某些链接 :
Some Links:
UPDATE :
UPDATE:
- WIX不会卸载旧版本 (主要升级失败的潜在原因)
旧条目 :
Older Entries:
- How can I find the Upgrade Code for an installed MSI file?
- How can I find the product GUID of an installed MSI setup?
- How To: Implement a Major Upgrade In Your Installer
- Majorupgrade or Upgrade ID which is preferred for Major upgrade?
- Major upgrades now easier than ever
还希望将您发送到WiX专家 Neil Sleightholm的站点,以获取一些已过时但仍然是真实示例的示例:
Also want to send you to WiX expert Neil Sleightholm's site for some dated, but still good real-world samples:
- WiX Script for Major Upgrades
- LaunchConditions, FindRelatedProducts and Downgrades
这篇关于将条目添加到MSI UpgradeTable中以删除相关产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!