I was mistaken in my belief that UUIDMBS would always be the same for a given user every time it is called, but instead gives a different random 128-bit UUID. Is there a way to get a UUID for a device that is the same every time, even if the user keeps the same PC, but updates their OS or peripherals? This is in a controlled environment of Windows/Mac/Linux PCs.
Is the MAC address best, or hard drive device # or something else?
Why not write a file somewhere with a random UUID, so that computer keeps it?
SystemInformationMBS module provides a couple of things like CPU brand string, Windows Product Key or Mac Serial.
Things you could use for an unique ID.
My code would have the same issue for David, a new UUID is generated with every use. Christian’s suggestion of using some preexisting id is the best, and I recommend the machine’s own UUID.
Well, the truth is that there is no real unique ID.
Anything on the disk can be cloned. Maybe you even run in a VM where they use a copy with the same VM which of course has same properties.
There are Macs without serial numbers, Windows installations without product keys, disks without serial number…
It can be difficult. If this is for a software protection, you can only gather something like 10 values, keep history and allow only to change one at a time. Even if user switches between configurations, you could allow that, e.g. allow to alter MAC address if others stay same.
“The easiest code to maintain is the code you never had to write” Steve Jobs at a WWDC
With Kem’s code I would need to keep a record of the UUID in a file somewhere on the device, while the MBS UUID below doesn’t (it uses the startup hard disc #, Mac serial number, Mac model and CPU).
I think I will use:
SystemInformationMBS.MachineID(15)
I will not use SystemInformationMBS.MachineID(31) since I don’t want the Windows user to look like a new device when they upgrade their Product Key with a new version of Windows.