views:

101

answers:

2

So from what little I understand about packaging for Macs, I see that the actual program that launches is the one defined under the CFBundleExecutable key in Info.plist.

<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>

Now, my app doesnt work if /APP/Content/MacOS/JavaApplicationStub is not chmodded +x (It just fails silently without doing anything, which is a pain!). Fair enough, its not executable I guess. But its a big problem if you are copying the app from somewhere that dosent support +x properties on files; such as windows, fat32 USB keys, CDROMs, websites, zip files, etc...

What can I do in these instances to make the app able to run? Manually setting the execute bit is not an option.

There's got to be people who run Mac apps off CD, at the very least!

+1  A: 

I think your only option is to package the APP bundle into a DMG file, or tar.

DMG is more standard and just as easy to do as using tar or zipping. The command line we use is:

hdiutil create -srcfolder Last.fm.app -format UDZO -imagekey zlib-level=9 -scrub Last.fm.dmg

You can tar from any platform, (even Windows, if you install cygwin, or use the GNU standalone, http://gnuwin32.sourceforge.net/packages/gtar.htm)

tar cf app.tar app_directory

With gzip compression:

tar czf app.tar.gz app_directory
Max Howell
+1  A: 

@mxcl, that works, sort of, thanks. However, you need to be on a Mac to run hdiutil :(. Also, it mucks up the paths of the app... there were some files(like the db file) that were not inside the .app folder, and thus are not included in the .DMG file.

Im building on windows, and the app is getting deployed to removable media. The whole point is to avoid installing anything.

The app runs on windows aswell, so there is a windows .exe alongside the mac.app on the root of the disk. There is also a sqllite.db file that both versions of the application share. Multi-platform is hard :/

dalyons
I ammended my answer to include tar. What platform do you want to do this from?
Max Howell
The final package doesn't have to be just the .app file. Though if you are distributing to the public and need to put files on their computers outside of the .app folder, you should use an mpkg installer.
Max Howell
I only just noticed the comments! :pEdited post to give more detail.
dalyons