I\'m developing a Windows Service installer using Wix. From what I understand, I should generate a unique Product ID for every Version of the service. This can be easily done by
Build Automation: You can use build automation in a number of ways to automate the creation of new product GUIDs and similar. You would pass in values to the WiX project file and such things, but perhaps that is not what you want to maintain. Let me add another option below.
Major Upgrade Element: I assume you have a major upgrade element in there? It takes care of uninstalling the previous version if configured correctly. Typically you see multiple versions in Add / Remove Programs when you re-build the same version and install on top of the last installation.
Suggestion: You can manually configure the Upgrade table to uninstall "same version installations"
. You take out the "auto-magic" of the "MajorUpgrade" element
and do things yourself with Upgrade elements
(an older way to configure the Upgrade table
that yields more detailed control):
Remove this (or just comment it out):
Add this:
<..>
<..>
Summary: The above should let you rebuild your setup and install any number of times using the same version number and the installation process will remove prior installation "auto-magically". Please test. No guarantees. Murphy's law. Etc... :-).
Some Links: