What's the preferred way to create a distributable file for Mac OS: dmg or pkg?
Regarding the disk image (DMG) approach, typically this is implemented in a way that makes obvious to the user that they need to drag the app over to their /Applications folder. (Sometimes this is done with a pre-existing alias of the /Applications folder next to the app icon on the DMG, and then a background image that has an arrow between them or text instructions overlaid that explains what to do.) Too often, though, users just double-click the app and run it from the disk image, which gets confusing (what if they eject the disk image? what happens next time they try to run the app?)
Alexander Limi, one of the Mozilla Firefox developers, has two great articles about getting your OS X app to detect when it's being run from the installer disk image, and then offering to copy itself to the /Applications folder.
It's an approach that's now accepted enough to have generated at least one code class, M3InstallController, to enable the behavior in your own app. The developer of another OS X app that takes this approach released his own code example, as well.
So if you go the route of a disk image with an app that needs to be dragged into the /Applications folder, strongly consider detecting whether the user is running the app from the disk image, and offer to move it for them! Your users, and your support folks, will thank you. :)
I don't think there's a fixed answer. If you just have an application bundle, I think most end-users expect a DMG. But if you're installing a menu extension -- or anything else that would need to be in a Library directory, you'll usually need a pkg file.
I've used both for different types of installs. They both work. As long as you use one of these two (and not some type of wacky install script), people will be happy IMHO.
Advantages of zips:
Advantages of dmgs:
Don't use .pkgs unless you need to place your bundle in a certain location. (WebKit bundles, Kernel extensions...)
The trend for Mac apps is a nice DMG with a drag-installable application on it. Or maybe even just a ZIPped application that knows how to copy itself to the user's Applications directory when launched.
Don't use an installer unless you absolutely have to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With