Let\'s say I generate my WIX XML file with a Product Id of *. Also for each Component GUID I use a *.
Product/@Id="*"
randomly generates a new GUID, which is sufficient for product codes. Component/@Guid="*"
calculates a GUID that stays the same as long as your target path stays the same, which is necessary to comply with component rules.
This may be somewhat misguided but I did have a lot of files I was importing as components into a new WiX Product.wxs
file. I discovered after I had created all the components with Guid="*"
that when trying to build the installer, WiX reported the following error for each component:
The component 'AjaxControlToolkit.dll' has a key file with path 'TARGETDIR\ajaxcontroltoolkit.dll'. Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid.
I used the following PowerShell script to assign a new guid to each component. Be aware that this script will modify the Product.wxs
file directly and a backup of the file should be kept in case something goes wrong:
(Get-Content Product.wxs) |
Foreach-Object { $guid = [guid]::NewGuid().ToString(); $_ -replace 'Guid="\*"',"Guid=""$guid"""} |
Out-File Product.wxs
Product ID (ProductCode) uniquely identifies everything in the installer package as a particular product. When you search to see if a previous version is installed search is performed on the Upgrade Code. For all items found with the particular Upgrade code Installer will note each of the Product Codes as different incarnations of the same product. So you can say a different product code of same upgrade code identifies different incarnations (versions if you will, of the same product).
This quick guideline can help you. Be sure the check the MSDN links referenced from that article for better understanding how it works.
You must set a value to the property "UpgradeCode" in your product element. Which must be unique and must remain the same for all of your future builds for the setup. The upgrade code is responsible for letting an installations upgrade or not upgrade depending on the setup versions being executed.
ie:-
<Product Id="*" Name="My Application" Language="1033" Version="1.1.0" Manufacturer="Myself :p" UpgradeCode="{561DA858-5398-4B87-8F3A-8B8BB12650F6}">
NOT maintaining a static upgrade code will result duplicating identical installations.
What links other versions to new version is the upgrade code. That should not change for the same product assuming you want to use the upgrade functionality. Otherwise it is almost like each version is a different product