Copying an .app using BMax

Archives Forums/MacOS X Discussion/Copying an .app using BMax

Tricky(Posted 2006) [#1]
I've encountered this problem before (with no solution so far), and I encountered it again.

I'm creating some kind of generator that creates some kind of package and has to include an executable to run it in the process.

In Windows it's easy, just copy all contents of such a file into the file the user will need and make sure it ends on .exe


On Mac it's a little complicated. I'm already aware of the directory structure Mac OS uses for its .app "files" and that's not the problem. The true Mac executable which is somewhere in the .app is a "UNIX executable file". When I write such a file I cannot make it become a "UNIX executable file". I've tried a few tricks (even with the UNIX CHMOD command) but nada. Now I'm still pretty green when it comes to UNIX, and I've not tried everything yet, so I'd like to hear some suggestions.


Todd(Posted 2006) [#2]
To make a file executable in Unix, you just need to set the executable bit:
chmod +x /path/to/file
Now you'll be able to run that file as an executable. If you want to put it in an application bundle (the special type of folder that the Finder treats as an applicaiton), make sure it goes into the ./Contents/MacOS/ folder inside the app folder. The executable must also be named exactly the same as the .app folder to run (or you need to have an Info.plist file that specifies the executable name).


Tricky(Posted 2006) [#3]
Thanks a lot... Yeah, I knew the .app bundle structure MacOS uses, that was not really my problem, it was just those UNIX executable files that got me every time. Anyway, thanks... ;)