Embed command line tool

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
matgarage
Posts: 79
Joined: Sat Apr 20, 2013 11:39 am

Embed command line tool

Post by matgarage »

Hi

I've coded an app that use a command line tool to execute color measure.
I would want to deploy and share this app with my colleague.
Is it possible to embed the command line tool inside the standalone and use it without installing it on the /bin folder(for example) on each machine ?

Thanks
Last edited by matgarage on Fri Jan 08, 2016 6:02 pm, edited 1 time in total.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Embed line command tool

Post by Klaus »

Hi Mat,

embed yes, use without saving no!
You have to to save it somewhere on the users harddisk before being able to execute it!
Maybe only temporarily in the TEMP folder? Check:
-> specialfolderpath("temporary")
and
-> the tempname
in the dictionary, maybe that helps.

Embedding:
I always put binary stuff (apps or whatever) im a custom property of my stack(s)
and "spit them out" as necessary like this:
...
answer file "Where is the tool?"
set the cCommandLineTool of this stack to url("binfile:" & it)
## Save the stack and that was it!
...

Spit out and execute immediatley:
...
put specialfolderpath("temporary") & "/an_unsuspicious_filename" into tTargetFile
put the cCommandLineTool of this stack to url("binfile:" & tTargetFile)
launch tTargetFile
...
You get the picture :D


Best

Klaus
matgarage
Posts: 79
Joined: Sat Apr 20, 2013 11:39 am

Re: Embed line command tool

Post by matgarage »

The wooow effect !

I would like to clone your brain to get your coding skills if it was not so funny to learn step by step. :-))

Thank you Klaus.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Embed command line tool

Post by Klaus »

Sorry, Mat, I'm un-clonable! :D
matgarage
Posts: 79
Joined: Sat Apr 20, 2013 11:39 am

Re: Embed command line tool

Post by matgarage »

Hi Klaus !
I need to correct your code (I can't realize I'm saying that...)

I've to put (into) :

Code: Select all

put the cCommandLineTool of this stack into url("binfile:" & tTargetFile)
instead of (to):

Code: Select all

put the cCommandLineTool of this stack to url("binfile:" & tTargetFile)
Just to help those who will read and use this after.

Ok, I understand that your are un-clonable Klaus, but, can I do a little 'brain backup' ?
Security first :-)
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Embed command line tool

Post by Klaus »

Hi Mat,
I need to correct your code (I can't realize I'm saying that...)
Haha, don't worry, see it just as a prove that I'm human! :D

Yes, sorry, of course it has to be:
... put ... INTO...


Best

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

Re: Embed command line tool

Post by SparkOut »

put "klausimausi/braindump.iso" into tBrainfile
set the uKlausbrain of this stack to URL("binfile:" & tBrainfile)
save this stack

Then you can write out the file and mount the iso to have your very own portable Klaus
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Embed command line tool

Post by Klaus »

SparkOut wrote:put "klausimausi/braindump.iso" into tBrainfile
set the uKlausbrain of this stack to URL("binfile:" & tBrainfile)
save this stack

Then you can write out the file and mount the iso to have your very own portable Klaus
:D :D :D
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Embed command line tool

Post by FourthWorld »

SparkOut wrote:put "klausimausi/braindump.iso" into tBrainfile
set the uKlausbrain of this stack to URL("binfile:" & tBrainfile)
save this stack

Then you can write out the file and mount the iso to have your very own portable Klaus
I tried that but got a permissions error noting that I wasn't the owner of that resource.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Embed command line tool

Post by Klaus »

Well, MY mother taught me to ask first before dealing with someone elses property (resource)! 8)
SparkOut
Posts: 2987
Joined: Sun Sep 23, 2007 4:58 pm

Re: Embed command line tool

Post by SparkOut »

Did you chown the file first?
matgarage
Posts: 79
Joined: Sat Apr 20, 2013 11:39 am

Re: Embed command line tool

Post by matgarage »

Put :D into myDay
Post Reply