0

As part of creating an .msi (An installer program), sometimes one has to generate a unique GUID. It is hard-coded, and used to uniquely identify the project, or folders (See here for an example).

I understand that when I generate a GUID on my machine, its guaranteed to be unique. But how can we guarantee it is unique on every computer the program will be installed on? What happens if you generate a GUID that already exists on the users machine?

john k
  • 6,268
  • 4
  • 55
  • 59
  • 1
    The U means Universal. It's unique in all the known Universe (including Andromeda galaxy). Probably uses the MAC of the machine (that should also be unique) – vals Jul 01 '21 at 14:57
  • *`While the probability that a UUID / GUID will be duplicated is not zero, it is close enough to zero to be negligible`* - [From Wikipedia](https://en.wikipedia.org/wiki/Universally_unique_identifier). What happens if you duplicate an MSI GUID? All kinds of nonsense (it is common to forget to change GUIDs if you should use a new identity for a component GUID or for the product itself for major upgrades). [When to change component GUIDs](https://stackoverflow.com/a/1422121/129130). Note that many GUIDs should remain constant for upgrades - specifically component GUIDs in most trivial cases. – Stein Åsmul Jul 02 '21 at 01:11

0 Answers0