问题描述
例如我有:
<Component Id='MainExecutable' Guid='0436E0CA-8612-4330-A70D-642910D9F19A'>
<File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
</File>
</Component>
如果我创建了一个更新包,我是否应该为包含 FoobarEXE 的组件使用相同的 GUID?我知道产品、升级代码等的规则,但其他 GUID 的规则是什么?它们的范围是什么?
If then I create an update package should I use the same GUID for component that include FoobarEXE? I know rule for Product, UpgradeCode etc but what is the rule for other GUIDs? What is their scope?
推荐答案
组件 ID 版本控制规则很棘手.我只在旧书中找到了真正的解释(仅限德语).根据您创建的更新,有几条规则适用.
The component id versioning rules are tricky. I have found a real explanation only in old books (german only). Depending on which update you are creating several rules do apply.
- 更新
更新(仅修补或添加文件,不允许删除或重新定位)组件 ID 必须保持不变.
Update (only patch or add files, no remove or relocation allowed)Component id has to stay the same.
小升级(产品代码保持稳定)它基本上是一个更新,放宽了一些规则.为了保持清晰,你应该坚持更新或主要升级,这更容易推理.产品代码必须更改时的规则 在这里描述.
Minor Upgrade (Product code remains stable)It is basically an Update with some rules relaxed. To stay clear you shouldstick to Update or Major Upgrade which is much easier to reason about.The rules when the product code must be changed are described here.
重大升级基本上是卸载(调用了 MSI 操作 RemoveExistingProducts)并重新安装.在那里你有充分的自由.
Major UpgradeIs basically a uninstall (the MSI action RemoveExistingProducts is called) and reinstall. There you have full freedom.
将每个文件、注册表项、环境变量放入单独的组件通常是一个很好的建议,因为许多陷阱源于在小升级期间无法从组件中删除文件的事实.但是通过一些技巧,您可以删除整个组件.
It is generally a good advice to put every file, registry key, environment variable into a separate component since many of the pitfalls arise from the fact that you cannot remove files from a component during a minor upgrade. But with some tricks you can remove an entire component.
这篇关于wix guid 使用规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!