Creating an app for distribution

Archives Forums/MacOS X Discussion/Creating an app for distribution

zeedoktor(Posted 2004) [#1]
Hi all,

I'm a newbie on OSX, and I'm wondering now what tools do I need to ship an application I create with bmx? I notice that most software I download either comes as a dmg or sit. Which is the preferrable method? Also, how do I make the app show Icons? I presume the good old days of RESRC's are over, at least all apps I looked at so far seem to use some wickedy wicked directory structure containing icons etc. Any hints on this end?

Thanks

- Balt


matt!(Posted 2004) [#2]
DMG is a disk image that looks more professional according to some people. TO be honest for small apps it's not worth the bother. SIT is a StuffIt file, sort of ZIP for Macs, or at least it was way back. Now the StuffIt app does ZIP, RAR, LZH and anything else you throw at it. So, anything goes.

ICONS can be made with Iconographer or similar, then copy and pasted between files from the Get Info window. I'd like to see better icon management or app bundling in BMX.

HTH,


Loonie(Posted 2004) [#3]
also, to run bmax you need xcode or project builder, so there's a package maker under the tools folder.......it's basically the basic osx installer


zeedoktor(Posted 2004) [#4]
Hell... how do you copy and paste an .icns file into the Get Info window? That does not work at all here. Please advise... thanks!


Perturbatio(Posted 2004) [#5]
take a look at this thread


Todd(Posted 2004) [#6]
Most OS X users will expect your App to be packaged as a Disk Image (dmg) file. It also happens to be Apple's preferred method of distributing files. You can use the "Disk Utility" under /Applications/Utilities to make a dmg.

Installer Packages (.pkg files made with the "Package Maker" utility) are fine, but they should only be used when you can't fit everything inside of the Application itself.


eni(Posted 2004) [#7]
Yup, definitely a disk image/dmg. A quick tip, make sure you choose the Image Format to be compressed - otherwise the images come out ridiculously huge (even bigger than the original source).


zeedoktor(Posted 2004) [#8]
How do you select a compressed image format? All I can select in DU is encryption, no option for compression tho.


matt!(Posted 2004) [#9]
See what I mean - too much hassle. ;)


Todd(Posted 2004) [#10]
You first create a normal, non-compressed image, and place all of your files in the disk that's mounted to your desktop. When you're through, eject the disk by dragging it to the trash. Then go into the disk utility and choose "Images -> Convert" from the menu, and choose "Compressed" from the "Image Format" field.


Phish(Posted 2004) [#11]
No no no no no no copy/pasting the icon is NOT the proper way to do it!! That's only meant for temporary or amateur customisation.

Assuming you have the developer tools installed...create an icns file (see /Developer/Applications/Utilities/Icon Composer.app), stick it in the app's package (right-click on the app, select "Show Package Contents"). Put it in YourApp.app/Contents/Resources/someName.icns.

The next step is to tell the system how to find the icon. In YourApp.app/Contents/ you need an "info.plist" file. I'd just steal one from another app and change the values in it. If you double click the info.plist, it should open automatically in "Property List Editor" which is easier than reading XML. The important key of course is "CFBundleIconFile", which you set to whatever you had as someName.icns. I'm not sure, but you should probably delete any keys which aren't relevant or you don't understand about for your app.

Finally, to make sure it has worked, show the Get Info window for your app, click the icon in the top left, and press backspace. This will make sure that any temporary icon the system has cached will be removed, putting it back to the "default" - i.e. what you just set it to what it is meant to be.

Voila, you have changed the icon properly and permanently. Now if BlitzMax would just do all this automatically... it would be nice if it automatically generated an info.plist file.

Hmm, perhaps I should post this as a tutorial on the relevant forum...


LeisureSuitLurie(Posted 2004) [#12]
FWIW, I think dmg is pointless. Just stuff the thing and be done with it.


marksibly(Posted 2004) [#13]

Hmm, perhaps I should post this as a tutorial on the relevant forum...



Excellent idea! Please do.

[edit]
OK, late to the party - again.
[/edit]


Todd(Posted 2004) [#14]
Hi,

Yes, Phish is right, the copy and paste method is not the correct way to set the icon. Since that method changes the file's resource fork, there's no guarantee that it will be preserved.

The method Phish described is a little complicated, but it's the way it's supposed to be done (it's done automatically in Xcode). Since the BlitzMax IDE doesn't do it yet, I wrote a little app to change an app's icon. You can download it here, along with the source code if someone wants to improve on it: IconSwitcher.dmg (169Kb)


podperson(Posted 2004) [#15]
Incidentally, you should look into packages.

A package in OS X is a directory that the system discloses to users as a file.

To see how a package is built, simply go to one of the Apple applications in the Applications folder (e.g. Address Book) and right (or control-) click on it and choose "Show Package Contents". All of this stuff is documented on Apple's website ... somewhere.

I actually haven't checked to see whether Blitz compiles apps as packages or not. If it does, it's easy to add stuff to a package this way. If not, it's easy to distribute your app and all its associated files as a package, making the whole thing much simpler and more attractive -- i.e. "mac-like" -- for your users.


Phish(Posted 2004) [#16]
Blitz does indeed compile as a package - that's exactly how I've built Triaction (PIMP: http://www.aelius.com/products/triaction.phtml ). Surely it's only carbon apps which aren't packages?

Also, packages surely have to be compressed using a sit or by being put in a dmg anyway, don't they?

Also, even if you do create a package (e.g. using Package Maker from the developer tools), I'm not sure people like them so much. Packages (in the .pkg(?) sense) are installers, and even though you might just be installing into /Applications, the user never knows if you might be putting crap all over their system.

More than a little off topic tonio, but feel free to make a new PoD for MacOS X in Blitz :-) Loved the original!


podperson(Posted 2004) [#17]
A package is any folder disguised as a single icon (which includes .pkgs). At least, it was in the good old days. You can turn a folder into a package simply by changing its extension (you don't need any tools as all).

To distribute a package you will need to archive it (.zip is built into 10.2+ you know... just right-click) or distribute it as a disk image (.dmg) file (the tools are in Applications/Utilities).

Mac apps tend to seem more professional when distributed as disk images (and you can customize the look of the dmg by adding background images to the windows and so forth), so I highly recommend that.

Carbon apps, libraries, and UNIX command line tools are not packages, everything else is. So, I guess I should have know BlitzMax was producing packages :)


SJB(Posted 2005) [#18]
I am working on a tool that will create applications complete with icons and version info in the info.plist.

The tool was originally meant as a hook between 3rd party editors and the blitzmax compiler, but can be used independently.

You need to have the icon in icns format. The OS X developer tools have the Icon Composer utility to make them.

BlitzBuddy can be downloaded here. Note that it is still in development, so may have bugs.

Read the included readme.

p.s.
Carbon apps, libraries, and UNIX command line tools are not packages, everything else is.

Not quite true. Carbon apps can be bundles, so can libraries (i.e. loadable bundles or frameworks). Classic apps, which can be Carbon-based, are not bundles.