How to generate a unique machine ID Crossplatform

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
titobal
Posts: 31
Joined: Thu Aug 06, 2009 1:51 pm

How to generate a unique machine ID Crossplatform

Post by titobal » Mon Sep 28, 2009 10:31 am

Hi,

I wonder if it is possible to generate a unique ID
per machine at runtime of a Runtime Revolution application.

I would like to generate a unique ID for Windows and Mac
machines with the same routines if possible.

Is this possible ?

How would you do that ?

Any help is welcomed.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Mon Sep 28, 2009 3:39 pm

Hi titobal,

on a Mac (OS X) you can use shell:
...
put shell("uuidgen") into tUUID
...
I am sure there is a tittle VBScript that you can use, but I have no idea :-)


Best

Klaus

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Mon Sep 28, 2009 6:00 pm

Do you need this each time the application is *run* or just the first time? What is it you're trying to accomplish? If you're just trying to get a unique identifier for the hardware would the MAC address from the network card do the trick?

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Mon Sep 28, 2009 8:57 pm

Klaus wrote: I am sure there is a tittle VBScript that you can use, but I have no idea :-)
:-)
on Windows:

do the uVBScript of <theObject> as "vbscript"
put the result

where the uVBScript is:

Set TypeLib = CreateObject("Scriptlet.TypeLib")
result = TypeLib.Guid

---
That's assuming you want to generate a (new) UUID/GUID (in this case type 4) at any time. If you want to get a unique ID that ties in to the particular machine hardware that you're running the app on, then something like interrogating the disk volume id string in Windows WMI might be more like what you need - can we have some more information as to what you need to achieve?

titobal
Posts: 31
Joined: Thu Aug 06, 2009 1:51 pm

I would like to get the same ID each time I run the app...

Post by titobal » Mon Sep 28, 2009 9:05 pm

Sorry if my initial request was not clear.

I need to do that :

1. Run the software on Computer 1

2. Get a unique ID based on Computer 1 characteristics
(mac address / ram / os version or other parameter which
do not change a lot during the computer's life...)

3. Based on the ID + Final User infos I would issue a key / serial number / registration number

How would you do that ?

I plan to use Zygodact but I would like to add the Computer ID on top of Zygodact...

Hope I'm clear now.

Thanks anyway for the GUID tips on mac & PC :-)

Mark Smith
Posts: 179
Joined: Sat Apr 08, 2006 11:08 pm
Contact:

Post by Mark Smith » Mon Sep 28, 2009 10:48 pm

Ken Ray has a great cross-platform handler for getting the MAC address here:

http://www.sonsothunder.com/devres/revo ... env001.htm

For UUIDs, I'll plug my own pure revolution stack (that uses Ken Ray's handler) for generating type 1,3 and 4 UUIDs, here:

http://futsoft.futilism.com/revolutionstuff.html

Best,

Mark Smith

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Mon Sep 28, 2009 11:10 pm

titobal-

Follow up on Mark Smith's links there and I think you'll get what you want, but...

if I understand what you're doing then personally I wouldn't do that. You're tying your license to a particular set of hardware and software and creating support headaches for yourself in the process. What happens when the user upgrades some equipment? What if their computer dies and they have to replace it? You'll have to generate new license codes in that case.

Post Reply