Question

I am working on creating a WiX installer for a product that will replace an older Visual Studio installer, and will provide a new build version (upgrading from 1.0.5 to 1.0.6). I understand that I need to let the Product's GUID be calculated by the installer, and that I need to make the product's upgrade code equal to what it was in previous iterations of the product.

What I need to know is how to determine the GUID for my components. I found the following statement:

Component GUID= - this is a product/component code that should be copied from the previous generation of the product. If that is not possible or feasible then the customer must be informed that they should uninstall the previous version before installing the new version. Otherwise there can be conflicts about which product code owns which file on the PC.

which I took to mean that the Guid would come from the assembly information of the assembly I am including in the component. Is that correct?

Thank you!

Was it helpful?

Solution

Not sure where you got that info from but that is not quite correct. The Component GUID has no relation to the assembly information at all.

The component GUIDs are just unique identifiers for each resource in the installer (it can be a file, registry key or even just a batch of sql scripts). If you have 2+ installers that will be installed side-by-side and can share some files then you can use the same GUIDs for the shared components. Windows installer will then handle the dependancies automatically. It might be easier with a real world example:

  • ProductA has ComponentA, ComponentB and ComponentC
  • ProductB has ComponentC, ComponentD and ComponentE

If both are installed ComponentC is only installed once if the GUID is the same. If InstallerB is un-installed ComponentC is left as ProductA still depends on it and vice-versa if ProductA is un-installed and ProductB is left. Only when both are removed will ComponentC be removed.

Complications can arise if ComponentC is changed (without changing the GUID) in ProductB which means it will be incompatible with ProductA. If this happens and a ProductB is upgraded this will break the install of ProductA. See http://msdn.microsoft.com/en-us/library/aa372795(v=vs.85).aspx for more info on component rules and other scenarios that will break your installs.

The easiest and safest way to handle them is to just use "*" as wix will then automatically generate a guid for that component.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top