Page 1 of 1
Embed command line tool
Posted: Fri Jan 08, 2016 5:13 pm
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
Re: Embed line command tool
Posted: Fri Jan 08, 2016 5:35 pm
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
Best
Klaus
Re: Embed line command tool
Posted: Fri Jan 08, 2016 6:01 pm
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.
Re: Embed command line tool
Posted: Fri Jan 08, 2016 10:16 pm
by Klaus
Sorry, Mat, I'm un-clonable!

Re: Embed command line tool
Posted: Sat Jan 09, 2016 12:08 pm
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

Re: Embed command line tool
Posted: Sat Jan 09, 2016 1:30 pm
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!
Yes, sorry, of course it has to be:
... put ... INTO...
Best
Klaus
Re: Embed command line tool
Posted: Sat Jan 09, 2016 4:30 pm
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
Re: Embed command line tool
Posted: Sat Jan 09, 2016 4:33 pm
by Klaus
Re: Embed command line tool
Posted: Sat Jan 09, 2016 7:54 pm
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.
Re: Embed command line tool
Posted: Sat Jan 09, 2016 7:59 pm
by Klaus
Well, MY mother taught me to ask first before dealing with someone elses property (resource)!

Re: Embed command line tool
Posted: Sat Jan 09, 2016 8:00 pm
by SparkOut
Did you chown the file first?
Re: Embed command line tool
Posted: Sun Jan 10, 2016 12:14 pm
by matgarage
Put

into myDay