local disk UUID ?

How can I get a UUID for a hard disk … both on win and mac?

On the Mac you can get it via the NSURL properties, MBS & MacOSLib both have the NSURL classes.

I can’t believe it’s this difficult is there no shell command for it. I can’t afford the plug-ins right now

MacOSLib isn’t a plugin, it’s a wrapper for the underlying Cocoa framework.

I seem to recall that someone has posted some command line functions for this, but NSURL is the correct API to use and doesn’t have any limitations that a system command line application may have. i.e. If there is an API for that, don’t use a command line application!

Forgot to add that the MacOSLib is free and Open Source.

On Windows this is the kind of information reported by WMI Computer System Hardware Classes :
http://msdn.microsoft.com/en-us/library/windows/desktop/aa389273(v=vs.85).aspx

In particular Win32_DiskDrive http://msdn.microsoft.com/en-us/library/windows/desktop/aa394132(v=vs.85).aspx

I believe string DeviceID; is what you need.

Those classes import into xojo ?

Those are Windows classes that must be called through declare http://documentation.xojo.com/index.php/Declare

Are there any example projects ? You see this is the last step before I can finally release this program. I got license keys being issued from easydigitaldownloads.com plugin for wordpress…

But I need to tie it to a computer… because even if i store the key encrypted in a textfile… people can share the textfile and would be able to bypass the license check…

so what i was going to do was encrypt the HDD/SSD UUID + LICENSE KEY… and that way the program could decrypt the string… check to see if the UUID matches before checking if the key is valid.

I need a way to do this on Mac and Windows… and so far… I am completely lost… with something that seems it would be so simple…

Ahah… There is an easier way for you to get something similar, although not so precise. Use the creation date of volume( 0 ). As Volume( 0 ) should be the boot volume and while it’s possible to get duplicates, it shouldn’t be likely. For added variance, you could also use the creation date of your sub folder within the Application Support folder.

Getting the drive UUID isn’t that difficult, once you understand how. It’s just that Xojo doesn’t support it out of the box, so it requires some understanding of the OS APIs. Trust me, once you learn about OS APIs you’ll be able to create far better applications as you’ll no longer be limited by the Xojo toolbox. In fact, this is one of the reasons as to why Xojo is the best x-plat development tool out there (I have experience with several others). Especially being able to mix & match is awesome!

One final word on drive UUIDs, I use them for Backup To Go (to identify and register disks), I have a ton of external drives in various formats and some of them don’t have any UUIDs, in this case I make a UUID based upon the drive size and creation date. (Because Backup To Go is Sandboxed I can’t simply create a text file with my own UUID and deposit it somewhere on the disk).

What about catching several values, like creation date of volume(0), UUID, CPU ID and maybe more - and later check if just one of them still matches? If yes, then allow it to pass.

The point is that the buyer could be a tinkerbell who likes to change parts of his computer. Maybe he changes his harddisk, but not the CPU - or the other way round.

I guess like this a license verification system would work more reliable and cause less trouble for a buyer. Any opinion on this?

diskutil info | grep ‘Volume UUID:’

Output:
Volume UUID: EE8C4FFD-6C4B-302D-B096-DCF81D4E13FB

I see how you try to guard your software against unauthorized use. I have no idea what your app is, but do not forget today users may have both a desktop and a laptop, and may want to use the software on both without trying to pirate. Will your license be, like old fashion licenses, tied only to a specific workstation, and growl on a customer who in good faith needs to use it on his laptop ? Will he have to buy twice ?

The more you constrain the user into a corner, the more you will get support requests. Are you prepared to graciously help legitimate customers who for a reason have had their hard disk replaced, or the whole computer, would that be because of a break down or some other issue ? Computers die sometimes.

I have a lot of customers who contact me after years of being happy with my software, because they had their computer replaced and lost their password. So I know.

Before launching such a severe protection scheme that the software will be tied to a specific hard disk, you may want to consider the customer needs. Not all passers by are shoplifters…

It is customary to require a separate license on each workstation/laptop. While it may be common to use the same license on a workstation and laptop, it is still technically piracy.

Guess you have never used the MAS or iTunes then.

In an age where users have often two computers, reasoning like that is vastly outdated. The workstation model may have been valid when desktop computers and application software were a rarity. Today software is nothing but a commodity with tough competition, and computers are becoming disposable. Apple and the Mac App Store, Microsoft and its one user/several computers model have long understood that.

The record industry with its paranoid fear of piracy has largely contributed with it’s stupid licensing terms to the explosion of piracy. Let’s not mistreat users the same way.

I am such an animal. I change parts regularly on my desktop. And upgrade other computers in my household with replaced partswhen applicable (the domino effect).

I currently use a wine cellar management software that stops working as soon as I change my hard disk, video adapter or pretty much anything else that can be changed on my computer. I have to write the software vendor every time with the new challenge code that the software gives me in order to receive and enter a new activation code. I recently told my software vendor that if the next release is still working in the same way, this is the end. I will seek an alternative. Enough already! There is a fine line between protecting one’s intellectual property and alienating honest paying customers.

You would never have me as a client should you go down the same route as my wine cellar software vendor. Or not for long anyways (is this a word? A long useless thread was started on this forum with this word or “unword”)

You are formulating exactly what countless customers will do silently and very efficiently, not to mention reports from bloggers and big sites that will in general make a point to compare the ill fated convoluted protection with competitors more respectful of their customers.

In general such shortsighted protections are done by newcomers to the market who instead of looking at what the competition does, spend more time inventing some insane piracy protection worth a mad scientist, instead of concentrating on selling their software sensibly.

Successful software vendors and big companies spend a lot less time on bizarre protection scheme, and a lot more time providing evaluation software and the best customer experience they can.

The most pitiful is that paranoid protections of all types will never prevent real pirates to break their ridiculous schemes. If it ever gains enough momentum to merit any interest from hackers…

the whole argument (discussion) on locking the software down to a particular computer VS letting the use it on both their laptop and desktop. People bring us things like MAS as an argument. I cant tell you which way to go or what you should do.

We allow our customers to install the software on both their laptop and desktop. They are only going to do one at a time. This makes the lockdown easier for both us and our customers.

and this discussion is beyond the scope of the original question.
sb