Reputation: 109
I use C#. Is it possible to make every installed instance has different guid?
To be more specific, let's say I have an application called "abc" and a setup for it. Each time it is installed on a different computer, I want it's assembly guid to be regenerated. If it's not possible, I always listen to new ideas.
Thanks in advance.
Upvotes: 4
Views: 929
Reputation: 9017
It sounds like you want to uniquely identify the machine on which your application is installed. There are many ways to do this - but changing the assembly GUID is not a good option for this.
Instead, you should look at the machine configuration, and generate a unique Id from it rather than generating a random id. For example, you could take the machines MAC address as a starting point.
This would make the machines unique id deterministic, meaning you don't need to store it anywhere, you can generate it each time you need it :)
Early versions of the GUID specification (version 1) actually used the machines MAC address as part of the GUID - however this led to security problems and was the cause of the Melissa virus. The modern GUID specification does not use MAC address data.
Upvotes: 0
Reputation: 2667
Why not just check for a file on startup ? You could then Generate a UID and insert it into the file. So the next time the Application loads you would be able to read the UID from the file ?
This could be either on a per user basis (where you would put the file in their user directory) or per installation (Where the file is right next to the executable or somewhere outside of the current user directory, just watch out for Windows File Permissions!).
Upvotes: 1