Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to use autogenerated GUID on Component tags

My scenario is this: I want the installer to completely remove the old version (all files except those created by the application during its lifetime) and replace it with the new version.

In my Wix script I use auto-generated GUID (asterisk) for Product ID and Package ID, while I use my own GUID for UpgradeCode which always stays same. What I'm not sure if I can safely use auto-generated GUID (asterisk) for Component tags as well, with respect to my scenario?

So far I was using NSIS. I wanted to try Wix but got a little doubt since people on forums say it will take you about 30 days to learn it while one can start off with NSIS in 1-2 days. However, for a standard installation that typical users need, it took me 2 days to get a really good installer package using Wix. If you have a little background in xml you should probably have no worries. Thanks to Rob and all the other contributors for creating the Wix!

like image 933
Marcus Frenkel Avatar asked Apr 20 '13 12:04

Marcus Frenkel


1 Answers

Yes, the auto-guid Component/@Guid are safe. They are done very specially to ensure that the GUID is generated in a way that is stable across releases for that Component such that the Component Rules are not violated.

Additionally, if you do not share Components with other Products and you always use major upgrades and you schedule the major upgrade early, then you don't have to worry about Component GUIDs much at all, because the two Component GUID definitions will never be on the machine at the same time. For example, the defaults for the MajorUpgrade element give you exactly this:

<MajorUpgrade DowngradeErrorMessage='A newer version of [ProductName] is installed.' />

So, the answer is, "Yes". :)

like image 190
Rob Mensching Avatar answered Oct 15 '22 14:10

Rob Mensching