什么时候应该更改或不更改 WIX 中的组件 GUID? Microsoft SDK 信息令人困惑。
Glytzhkof 编辑:澄清一下,问题涉及何时应更改 MSI 组件的组件 GUID。组件可以在以下方面进行更改:更改目标路径、在同一组件中添加或删除文件、添加注册表数据等...这会导致所谓的组件引用(即 在 MSI 中创建组件的最佳实践。
When should I change or not change my component GUID in WIX? The Microsoft SDK information is confusing.
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.
发布评论
评论(3)
Rob Mensching(WiX 作者):
有关组件规则的更多信息:
我使用一些简单规则来处理过于复杂且相当违反直觉的组件规则(特别是对于开发人员而不是部署专家):
SampleDriver.cat
、<代码>SampleDriver.inf、SampleDriver.sys
、SampleDriver.cer
。它们必须作为一个“单元”全部匹配才能部署。一些示例:
Rob Mensching (WiX author):
More on Component Rules:
I use some simple rules to deal with the overly complex and rather counterintuitive component rules (especially for developers as opposed to deployment specialists):
SampleDriver.cat
,SampleDriver.inf
,SampleDriver.sys
,SampleDriver.cer
. They must all match as a "unit" for deployment.Some samples:
您永远不会更改 Component/@Guid。您也永远不会更改组件中的资源集(文件、RegistryKey、快捷方式、TypeLib 等)。当你有一个新的资源时,你必须使用新的@Guid创建一个新的组件。真正棘手的部分是新组件不能与旧组件重叠(例如文件路径、注册表项路径或 typelib 等)。
这些基本上是组件规则,请查看:https:// /robmensching.com/blog/posts/2003/10/18/component-rules-101/。
You never change the Component/@Guid. You also never change the set of Resources (File, RegistryKey, Shortcut, TypeLib, etc.) in the Component. When you have a new Resource, you must create a new Component with a new @Guid. The really tricky part is that new Component can have no overlap (think file path, or registry key path, or typelib, etc.) with the old Component.
These are basically the Component Rules, check out: https://robmensching.com/blog/posts/2003/10/18/component-rules-101/.
查看 WiX 教程,里面的文件,有关组件规则的详细说明。基本上,它表示您永远不会更改组件的 GUID,因为这意味着孤立旧组件并创建新组件。
Have a look at the WiX Tutorial, The Files Inside, for a detailed explanation on component rules. Basically, it says you never change the GUID of a component, since that means orphaning the old component and creating a new component.