Get Persistant ID of the material used

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
ekami
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 27
Joined: Tue Jun 05, 2012 4:08 pm

Get Persistant ID of the material used

Post by ekami » Wed Dec 10, 2014 5:39 pm

Hello From France
In FileMaker Pro 12 and >, i use the function Obtain(IDPersistant) , a unique ID (non modifiable) of the material which FileMaker is executed : 32 hex chars string.
I can do the same thing in LiveCode on OSX and windows using do scripts ( AS or VBA , but these "do scripts" doesn't work on LiveCode 7 rc2 standalones )
A native function in LiveCode would be very useful.
Excuse for my bad english and thanks for your responses.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get Persistant ID of the material used

Post by FourthWorld » Wed Dec 10, 2014 5:56 pm

If I understand your post correctly I think what you'll find what you're looking for in the Dictionary entry for the UUID function.

As for "do script" not working on Windows in v7 where it had in previous versions, please submit a bug report on that:
http://quality.runrev.com/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ekami
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 27
Joined: Tue Jun 05, 2012 4:08 pm

Re: Get Persistant ID of the material used

Post by ekami » Wed Dec 10, 2014 6:20 pm

Hello.
UUID function of LiveCode can't be used for what i'm looking for.
I need getting a PERMANENT ID of the material LiveCode (or standalone) is executed on.
This ID must return an unique ID of my material, so it can't change: it must be constant, not variable.
Cordialy, Joan.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get Persistant ID of the material used

Post by FourthWorld » Wed Dec 10, 2014 6:38 pm

In this context what constitutes "material", and how will this identifier be used?

It may be that the sha1digest function will suffice, bit it's hard to say until I know more details about what's needed.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ekami
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 27
Joined: Tue Jun 05, 2012 4:08 pm

Re: Get Persistant ID of the material used

Post by ekami » Wed Dec 10, 2014 7:11 pm

Material = Motherboard
i need to get an ID (unique for every motherboard) to install runtimes made with LiveCode on specific computers.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get Persistant ID of the material used

Post by FourthWorld » Wed Dec 10, 2014 8:10 pm

Thanks. I wouldn't have been able to guess that "material" could mean "motherboard".

What API calls would you use to do this in VB?

FileMaker's documentation on this is very sparse:
http://www.filemaker.com/help/12/fmp/ht ... 32.54.html

So I called a friend who's quite experienced with FileMaker, and he tells me that the older function, Get(NICAddress) used to return the identifier for the network card on the device, and more recently Get(PersistentID) has gone through some changes: initially it was a value provided by the device hardware, but Apple nixed that for security reasons. So at this point that function uses an arbitrary UUID created by FileMaker on install.

With that in mind, my FMP developer friend says that what he does these days is pretty much as I suggested: he generates a UUID on install and stores that, obtaining that value any time he needs it in subsequent sessions.

In LiveCode this can be done with the UUID function.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ekami
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 27
Joined: Tue Jun 05, 2012 4:08 pm

Re: Get Persistant ID of the material used

Post by ekami » Thu Dec 11, 2014 12:11 am

The FileMaker Pro get(PersistentID) works inside FMP itself and within runtime solutions created with the "Advanced" version, and returns the same string on both cases (on the same Mac).
I don't know where it's stored on the computer at the installation of FMP, this doesn't matter for me.
Even if i trash a runtime created with FMP and re-install it, the PersistentID remains the same: that works !
--
Creating a UUID at first launch of a LiveCode runtime supposes that this UUID has to be stored outside the app (runtimes are read only, a big problem of LiveCode, not in HyperCard :wink: ), so it can be read and changed, or the file containing the UUID can be trashed. Using an UUID is a good idea, but if the file containing it is trashed, or if the runtime is trashed and re-installed, another UUID will be created, and that's absolutely NOT what i need.
I absolutely need obtaining the SAME value any time i need in subsequent sessions.
What i need is an unique ID i can get via openstack of the runtime via a "get" function, and store directly in a global variable.
i actually does this with AppleScript and VB,(i spent lots of hours of tests to create these scripts) but a special function in LiveCode would be better and extremely useful.
I suppose that if FMPro engineers created the get(PersistentID), the LiveCode team can code a similar function in LiveCode.
Cordially, Joan.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Get Persistant ID of the material used

Post by jacque » Thu Dec 11, 2014 7:14 pm

Go here: http://www.sonsothunder.com/devres/live ... vecode.htm

There are scripts there that show you how to get the volume serial number, the MAC address, and the name of the boot volume.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get Persistant ID of the material used

Post by FourthWorld » Thu Dec 11, 2014 7:53 pm

ekami wrote:...(runtimes are read only, a big problem of LiveCode, not in HyperCard :wink: )...
If that's a problem at all (OS designers see it as a security feature) it's with pretty much all modern OSes rather than with LiveCode: OSes don't allow executables to modify themselves.

HyperCard was able to have standalones that saved to themselves only because the Mac's HFS file system is uniquely dual-forked, and in older versions of Mac OS code modules resided in the resource fork, leaving the data fork free for modifiable data. While HFS+ continues to support the resource fork for legacy reasons Apple strongly discourages its use in new code. Moreover, the Mach kernel in OS X expects executable code to reside in the data fork, and like other OSes won't allow its modification at runtime.
...it can be read and changed, or the file containing the UUID can be trashed.
NICs can be changed, as can the primary volume. I'm not familiar with a way to obtain the ID of the motherboard, but would be interested in learning if you're in a position to share your AppleScript for that.
Using an UUID is a good idea, but if the file containing it is trashed, or if the runtime is trashed and re-installed, another UUID will be created, and that's absolutely NOT what i need.
Just trying to help. I still don't know why this is needed so I was only able to guess that UUID might be useful. If not, calling AppleScript from LC is an option, along with the examples Jacque pointed to.
I suppose that if FMPro engineers created the get(PersistentID), the LiveCode team can code a similar function in LiveCode.
You're certainly welcome to submit a request for that:
http://quality.runrev.com/

It would be nice to have it in the future, but if you need this now you may want to explore alternatives such as one at the link Jacque provided.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ekami
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 27
Joined: Tue Jun 05, 2012 4:08 pm

Re: Get Persistant ID of the material used

Post by ekami » Thu Dec 11, 2014 8:14 pm

Many thanks to Jacque and Richard for the informations and links.
The volume serial number must be the ID of the hard disk (but if the disk changes, this ID too), the MAC adress can be spoofed, and the name of the boot volume can be modified.
So none of these values are useful for me.
Sorry, but i can't share my scripts to get an unique IDs from the hardware (confidentiality), but for the OSX case it's very easy to find on AppleScript forums.

Post Reply