Machine serial number

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Don Pederson
Posts: 6
Joined: Thu Jun 01, 2006 7:20 pm

Machine serial number

Post by Don Pederson » Fri Jun 12, 2009 6:46 pm

How do I get the machine serial number of a mac from a revolution script?

We want to authorize machines to use our software by checking the machine serial number.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Jun 12, 2009 10:08 pm

Hi Don,

You should keep in mind that there are Macs that don't have a serial number (anymore) and that there is software to change this number.

The following function only works on Macs with an unmodified logic board:

Code: Select all

function systemSerialNumber
     put shell("system_profiler SPHardwareDataType") into mySysInfo
     return last word of line lineoffset("Serial Number",mySysInfo) of mySysInfo
end systemSerialNumber
Actually, I have only 1 Mac, out of 3 running Mac OS X, on which this function works. Also, I am not even sure whether this should work with all versions of Mac OS X (and a pristine hardware configuration).

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Machine serial number

Post by jmburnod » Tue Jun 16, 2009 9:36 pm

Hi Mark and Don

I compare the function systemSerialNumber() of Mark.It return the same result like machineSerialNumber() of Supercard.

Regards

Jean-Marc

Post Reply