Problems with Application Executable

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Problems with Application Executable

Post by makeshyft » Thu Sep 03, 2015 8:31 pm

Hi,

I've built an installer for my application, that saves all files stored in an array using "put URL ("binfile:" ....)" command to save to an .app application forlder in /Applications/

All the files seem to save ok, the icon for the app package is correct, all the files seem to be there in the package, BUT

the main executable "UMP" in "Contents/MacOS/" is listed as "Kind: SimpleText Format" and is set to open with TextEdit.app"

the original file is otherwise treated as "Kind:UNIX Executable File" and is set to open with Terminal.app" and launches fine when copied using the file system. Just doesn't work when saved by the installer as a binary file from within memory.

Any help would be greatly appreciated.

PS> Windows version works flawlessly.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Problems with Application Executable

Post by makeshyft » Mon Sep 07, 2015 6:25 pm

So I am half-way to a solution, and have found the FileType property. But I can't find the Code to use to make the file "Unix Executable"

Does anyone know the code to use?

I have tried empty, but it makes it "unknown", I need it to be Unix Executable.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Problems with Application Executable

Post by Klaus » Mon Sep 07, 2015 7:35 pm

Hi Tom,

you obviously need to set the "executable" bit for this file (again)!
You can do so via SHELL:
...
put "path/to/your/unix_executable_wannabe_file" into tPath
get shell("chmod -x" && QUOTE & tPath & QUOTE)
## QUOTES in case the path contains spaces.
...
But this should have been preserved somehow, shouldn't it!?
How do you copy these files and where do you store them in your installer?


Best

Klaus

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Problems with Application Executable

Post by makeshyft » Mon Sep 07, 2015 7:55 pm

Hi Klaus, thanks for yoour reply, I will try that.

I first

put url ("binfile:" & line f of UMPMemory["Total File List"]) into UMPMemory["File Data Array"][f]["file_binary"]

then I encode the array and save it in a custom property

.... then i build the standalone

then the standalone:

for each element I ....

put UMPMemory["Files To Install"][WhatFileNumber]["file_binary"] into URL ("binfile:" & compiled_file_name)

pretty simple stuff....

I suspect that your solution will work...I will come back and report.

Thank you.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Problems with Application Executable

Post by Klaus » Mon Sep 07, 2015 8:26 pm

Hi Tom,
makeshyft wrote:...then I encode the array and save it in a custom property...
you can save an array directly into a custom property without the need of any encoding!
At least with version >= 6.x if I remember correctly.
makeshyft wrote:...
put UMPMemory["Files To Install"][WhatFileNumber]["file_binary"] into URL ("binfile:" & compiled_file_name)
pretty simple stuff....
OK, just wanted to be sure :D


Best

Klaus

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Problems with Application Executable

Post by makeshyft » Mon Sep 07, 2015 8:31 pm

ah cool..didn't know that...I also compress it, which is I think why I preferred to have it as one large binary variable. The whole installer is about 100 MB, so its not a big deal, takes almost no time.

Thanks Klaus
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Problems with Application Executable

Post by makeshyft » Mon Sep 07, 2015 9:32 pm

the solution posted there does not appear to be working ..... there is nothing in "the result" so the command does not return an error. but the executable remains as "Document" ... i set thefiletype to empty..which is why its document..... if i don't ..the filetype becomes simpleText. :( the shell command does not seem to make a change.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Problems with Application Executable (Solved)

Post by makeshyft » Tue Sep 08, 2015 2:14 am

Problem solved ..... ("chmod +x " & filepath) worked.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply

Return to “Mac OS”