Making a Mac OS X package

BlitzMax Forums/BlitzMax Programming/Making a Mac OS X package

Will(Posted 2005) [#1]
You know how on OS X the apps are in a nice single-icon and you click it and it opens? Well Blitzmax apps are built this way too, you can right click one and hit package-contents to see whats inside it. I want to hide all my data from the user and make my app very simple, one file they double click on. I can move my data files into the package, but how do I change my file-paths to be refer to inside the package?


tesuji(Posted 2005) [#2]
Assuming I understand you correctly and you simply want to know how to include data files from within your application...

I just stick my data files inside the applications directory structure and reference them from the app like this :
appname+".app/Contents/Resources/"+datafilename
where appname is just the application filename. I had to manually create the Contents/Resources sub directories.

Another way may be to use the incbin command which I think embeds binary files in the actual app file itself but I've not tried that yet myself.

Of course if the data files are dynamic and can be altered by the user e.g. preference files, it's best to keep them in :
"/Users/"+user+"/Library/Application Support/"+appname

For distribution I just zip the app directory up into a single file which the user can simply unpack and drag into their applications directory. No need for a fancy installer unless you have to install files all over the place.

HTH