在wix中更改我的组件GUID? [英] Change my component GUID in wix?

查看:142
本文介绍了在wix中更改我的组件GUID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

何时应该在WIX中更改或不更改组件GUID? Glytzhkofedit :为澄清起见,该问题涉及何时应为MSI组件更改组件GUID.组件可以随以下方面进行更改:更改的目标路径,向同一组件添加文件或从同一组件删除文件,添加注册表数据等...这会导致所谓的组件引用方面的问题,即在MSI中创建组件的最佳做法.

Glytzhkof edit: To clarify, the question deals with when a component GUID should be changed for an MSI component. A component can change with aspects such as: changed destination path, addition or removal of files to/from the same component, addition of registry data etc... This causes problems with regards to the so called component referencing, i.e the best practice for creating components in MSI.

推荐答案

MSI的总体概念是,两者之间存在 1:1映射 组件GUID (唯一标识符)和绝对路径 (安装位置/密钥路径).完整路径,包括文件名(如果) 任何.参见下面的更新以获取新的Wix功能,以自动处理 与此.

The overall concept of MSI is that there is a 1:1 mapping between a component GUID (unique identifier) and an absolute path (install location / key path). The full path, including file name if any. See update below for a new Wix feature to deal auto-magically with this.

我使用一些简单规则来处理过于复杂和荒谬的组件规则:

I use some simple rules to deal with the overly complex and nonsensical component rules:

  • 每个文件始终使用单独的组件(即使对于非二进制文件也是如此).这样可以避免各种问题.有一些例外:
    • 多文件.NET程序集应全部位于一个组件中,因为它们应始终作为一个单元进行安装/卸载.
    • 其他一些常规文件类型匹配对" 出现-它们属于同一类.这些通常是内容和索引文件.作为示例,请考虑Microsoft帮助文件:
      • .HLP文件和.CNT文件一起属于
      • .CHM和.CHI文件在一起.
      • Always use a separate component per file (even for non-binaries). This avoids all kinds of problems. There are a few exceptions:
        • Multi-file .NET assemblies should all be in one component since they should always be installed / uninstalled as a single unit.
        • A few other, general file types come in "matching pairs" - they belong together. Often these are content and index files. As an example consider Microsoft help files:
          • .HLP and .CNT files belong together.
          • .CHM and .CHI files belong together.

          一些样本:

          • 您将文件 C:\ Program Files \ MyCompany \ MyApp \ MyFile.exe 重命名为 C:\ Program Files \ MyCompany \ MyApp \ MyFile_NEW.exe .这对于创建组件意味着什么?这是一条新的绝对安装路径,因此您将为托管组件生成一个新的GUID,或者添加一个新组件并删除旧的组件(具有相同的效果).
          • 您更新的MSI提供了MyFile.exe的新版本.位置与以前相同,这意味着组件GUID不应更改.它是同一文件(身份),只是版本不同.
          • You rename the file C:\Program Files\MyCompany\MyApp\MyFile.exe to C:\Program Files\MyCompany\MyApp\MyFile_NEW.exe. What does this mean for component creation? This is a new absolute installation path, so you generate a new GUID for the hosting component, OR you add a new component and delete the old one (which has the same effect).
          • Your updated MSI delivers a new version of MyFile.exe. The location is the same as before, this means the component GUID should not change. It is the same file (identity), just in a different version.

          更新:

          自动组件GUID :WIX现在具有新的 calculates a GUID ,只要是目标路径 保持不变.老实说,我还没有尝试过,但是似乎很多 可以毫无问题地使用它,并且 Rob Mensching (Wix author) states it is safe for normal use .作为一个概念,我强烈建议您这样做 因为它具有一些自动魔术并可以使您免受某些伤害 复杂性.

          Auto Component-GUIDs: WIX now has a new auto-generate component GUID feature that calculates a GUID as long as the target path stays the same. I have not tried this out to be honest, but many seem to use it without problems, and Rob Mensching (Wix author) states it is safe for normal use. As a concept I highly recommend this since it features some auto-magic and shields you from some complexity.

          最小WiX标记 :另请注意, 您可以离开从很多来源属性 您的Wix xml文件 ,并依靠Wix默认设置而不是硬 编码值.

          Minimal WiX Markup: Also note that you can leave out a lot of source attributes from your Wix xml file and rely on Wix defaults instead of hard coding values.

          这篇关于在wix中更改我的组件GUID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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