Reputation: 1251
For example I have:
<Component Id='MainExecutable' Guid='0436E0CA-8612-4330-A70D-642910D9F19A'>
<File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
</File>
</Component>
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?
Upvotes: 1
Views: 381
Reputation: 13545
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.
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 should stick to Update or Major Upgrade which is much easier to reason about. The rules when the product code must be changed are described here.
Major Upgrade Is 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.
Upvotes: 2