MSI/WiX - 在多实例转换期间分配组件 GUID [英] MSI/WiX - Assigning Component GUID's during Multiple Instance Transforms

查看:17
本文介绍了MSI/WiX - 在多实例转换期间分配组件 GUID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 WiX 3.5,我有一个带有实例转换的 MSI,允许我将软件安装在具有不同产品名称的同一台机器上.为此,我在 .wxs 文件中有条件定义的产品 ID 和名称的硬编码"列表.但是,我只有一个包含文件和非文件资源的 Feature-ComponentRef 定义.

Using WiX 3.5, I have an MSI with instance transforms allowing me to install the software on the same machine with different product names. To do this, I have a "hard-coded" list of product id's and names in the .wxs file defined conditionally. However, I have only the single Feature-ComponentRef definition that includes both file and non-file resources.

安装似乎工作正常,但卸载实例显示了这两个来源中提到的行为:

Installation appears to work fine, but uninstalling the instances demonstrates the behaviour mentioned in these two sources:

http://msdn.microsoft.com/en-us/library/aa367797(v=VS.85).aspx

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Multiple-Instance-Transforms-Walkthrough-Proposed-Simple-Addition-to-WiX-to-Make-Them-Easier-td708828.html

具体来说,除了我的应用程序的最后一个实例之外,没有任何非文件资源(在本例中为注册表项)被卸载.(即,如果我按以下顺序卸载:instance1、instance2 和 instance3 - 仅删除 instance3 的非文件资源.

Specifically, none of the non-file resources (in this case, registry entries) get uninstalled save the very last instance of my application. (i.e., if I uninstall in this order: instance1, instance2, and instance3 - only instance3's non-file resources are removed.

我假设这与非文件组件没有唯一的 GUID 有关(而这不是文件组件的问题)

I am presuming this is related to not having unique GUID's for nonfile components (whereas this isn't an issue for file components)

所以,我想知道是否一种有效的方法是定义具有一个产品 ID、名称和一组功能的单个 .wxs 文件,但让自定义引导程序为产品和非文件组件生成新的 GUID然后在运行时插入 MSI 数据库?即,当需要卸载或更新时,我会在注册表中查询已安装的实例并检索它们的 GUID.

So, I was wondering whether a valid approach would be to define a single .wxs file with one product id, name and one set of features, but have a custom bootstrapper generate new GUID's for the product and non-file components which then get inserted into the MSI database at runtime? i.e., Then when it comes time to uninstall or update, I would query the registry for installed instances and retrieve their GUIDs then.

这将允许在运行时创建实例,而不是提前在 .wxs 中硬编码,然后彻底卸载.

This would permit instances to be created at runtime rather than hardcoded in the .wxs in advance, and to be uninstalled cleanly.

这有意义吗?Burn会让一切变得更好吗?:)

Does that make sense? Will Burn make everything better? :)

推荐答案

从 v3.6.1511.0 版本开始,组件现在有一个MultiInstance"属性.这允许根据 Josh Rowes 在他对 WiX 邮件列表的帖子中的建议(请参阅 OP 中的链接)为每个实例动态生成一个 guid.我已经测试过,这可以正常工作,以在卸载当前实例时删除注册表数据,而不是在卸载 LAST 实例时.

As of version v3.6.1511.0, there is now a "MultiInstance" attribute for components. This allows a guid to be generated on the fly for each instance as per Josh Rowes suggestion in his post to the WiX mailing list (see the link in the OP). I have tested and this works correctly to cause registry data to be removed when the current instance is uninstalled, and not when the LAST instance is uninstalled.

这篇关于MSI/WiX - 在多实例转换期间分配组件 GUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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