This is the first time when I'm in need of making a setup, so using Inno-Setup. But one thing I'm unable to find in the documentation that is the "Generate GUID" button really generates globally unique ID?? Can I use this as AppId of my app for production purpose??
If yes then how it guarantees that it will be unique for production globally? I mean is this "Generate GUID" feature tracking all software's AppId in the world to make next one unique, or its generating it using the files being packed into the setup??
GUID generated by that feature is as unique as a GUID generated by the underlying CoCreateGuid API function. You're free to use it for the AppId directive, but no one gurantee you that will be unique within the system. Everyone can still type there the same GUID as you generate, though the chance is very small.
If you really afraid of its uniqueness, you can use the {code:..} constant and generate it at runtime.
While you could generate the GUID at runtime as TLama noted - the issue would then become that when someone upgrades the installation when a new update comes out (you release an update/bugfix), that the installer would not be able to determine which GUID to update internally. You would need to write something complex to determine if the application was already installed without using the GUID to identify it (since it would theoretically be a different GUID on every single users machine that installed it).
As for what the GUID should consist of: A GUID is normally the 8-4-4-4-12 Hex, but Innosetup allows you to use whatever you want. You could, instead of generating a GUID, use a value like "JayadrathaMondal_ApplicationName_For_Company." As long as it does not ever change (e.g. don't make it dependent on the version number), you should be good forever.
There is not a centralized tracking service to guarantee that the GUID you set would be either already used, nor that the one you select would be unusable by others moving forward.
However, GUIDs are supposed to be unique enough that it is very unlikely. Consider the following from Wikipedia on this:
From Wikipedia > GUIDs (Globally unique identifier):
[...] GUIDs generated from random numbers normally contain 6 fixed bits (these indicate that the GUID is random) and 122 random bits; the total number of unique such GUIDs is 2122 (approximately 5.3×1036). This number is so large that the probability of the same number being generated randomly twice is negligible; however other GUID versions have different uniqueness properties and probabilities, ranging from guaranteed uniqueness to likely duplicates. Assuming uniform probability for simplicity, the probability of one duplicate would be about 50% if every person on earth as of 2014 owned 600 million GUIDs.
Imagine that every person on earth (7,000,000,000 people) was a software developer, and they all created 600,000,000 applications that all used a GUID. There would be a total of 6e17 GUIDs in use, and any new ones have about a 50% chance of already existing.
That number decreases as you start discounting people from that 7 billion that wouldn't be generating their own GUIDs (non-developers).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With