Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WIX Autogenerate GUID *?

Tags:

c#

guid

wix

Let's say I generate my WIX XML file with a Product Id of *. Also for each Component GUID I use a *.

  <Product Id="*" Name="xxx" Language="1033" Version="1.0.0.0" Manufacturer="xxx" UpgradeCode="xxx"> 

Behind the scenes is the * spinning a unique GUID each time I compile my WIX Installer? Let's say I have version 1.0.0 installed a machine. Then I recompile my WIX Installer to version 1.0.1.

When I go to install 1.0.1 how does WIX know that 1.0.0 is already installed and thus will remove all files/registry entries and install 1.0.1?

Should I be using * from GUID or should I have a unique ID/GUID in my WIX XML configuration?

like image 572
aherrick Avatar asked Apr 29 '11 12:04

aherrick


People also ask

How to generate GUID for WiX?

To generate GUIDs use the guidgen tool that ships with Visual Studio, generally located under Tools > Create GUID menu, or the GuidGen.com site. GUIDs generated this way will work fine in WiX, however since they are in mixed case they may cause issues if you share them with users of other, non-WiX tools.

How do I generate a GUID?

To Generate a GUID in Windows 10 with PowerShell, Type or copy-paste the following command: [guid]::NewGuid() . This will produce a new GUID in the output. Alternatively, you can run the command '{'+[guid]::NewGuid(). ToString()+'}' to get a new GUID in the traditional Registry format.

What is KeyPath in WiX?

The KeyPath for a Component is a single resource that the Windows Installer uses to determine if a Component "exists" on a machine.


1 Answers

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.

like image 97
Bob Arnson Avatar answered Oct 11 '22 02:10

Bob Arnson