MacPros & MacCons: Bundles
March 23rd, 2009On Windows, you run an installer. On Linux, you install a package.
On Mac, you just copy a folder somewhere. Anywhere.
Inside the .app folder (bundle), is an Info.plist. It describes all the file extensions that this application can use. It describes the URL schemas this application supports. It tells OS X what version it is, its localised pretty name.
The bundle contains all the libraries it needs to work. It is self contained. This is less efficient. You may end up running two copies of the same library in memory. But it improves reliability. As a product developer, I am assured by this system. I can be certain, in the event of a bug, that my app is only using the code I shipped. As a user, I know I can copy a .app bundle to anyone’s system, and it will run, because it has everything it needs already.
You don’t need administrative privileges to install a bundle. Trying out an application can’t break your Mac’s root system.
To delete an application, you just drag it to trash. You’re fairly assured that the app is gone. On Windows and Linux the uninstall may not be thorough. It may modify your system on the way out. There’s no assurances.
People complain that dragging for trash doesn’t allow the app to clean up. Which is true. “Your home directory is littered with files” is the general complaint. Usually however this is just a preference plist in ~/Library/Preferences and some app data in ~/Library/Application Support. Easy to clean up by hand. And also, I can’t think of any Windows or Linux applications that clean up the home directory when they uninstall.
Still people would be more assured an app is gone if it could do some kind of uninstall step when trashed. So it’s a con.
For developers, .app bundles can be a pain. Installers are possible, Apple even provide a native, standardised installation system that writes a receipt of the files it installs to /Library/Receipts. But you are encouraged to avoid them.
For our Last.fm app we needed to install an iTunes plugin. And we wanted to continue distributing our application as a bundle. With a little more work we had the app copying the plugin to the user’s iTunes plugin home directory on first use. And we made the plugin delete itself when it found that the Last.fm app no longer existed.
Overall I think the above system is better. On Windows we would have just expected the user to use the uninstaller. If they hadn’t, the iTunes plugin would never have been uninstalled.
I like bundles because it is one less thing that can go wrong. Installers are complicated. They require testing. They are hard to debug.


