Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packaging a Mac app for distribution [closed]

Tags:

macos

dmg

What's the preferred way to create a distributable file for Mac OS: dmg or pkg?

like image 298
Sunil Kumar Sahoo Avatar asked Nov 19 '09 18:11

Sunil Kumar Sahoo


4 Answers

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.

  • http://limi.net/articles/improving-the-mac-installer-for-firefox/
  • http://limi.net/articles/firefox-mac-installation-experience-revisited/

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. :)

like image 200
delfuego Avatar answered Oct 13 '22 00:10

delfuego


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.

like image 23
Geoff Hutchison Avatar answered Oct 13 '22 01:10

Geoff Hutchison


Advantages of zips:

  • Safari auto-unzips
  • Easy to create
  • Easier to use with Sparkle updater

Advantages of dmgs:

  • Can be used to display a license aggrement
  • Can display install instructions (DMG Canvas)

Don't use .pkgs unless you need to place your bundle in a certain location. (WebKit bundles, Kernel extensions...)

like image 37
Thomas Zoechling Avatar answered Oct 12 '22 23:10

Thomas Zoechling


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.

like image 39
Sixten Otto Avatar answered Oct 13 '22 01:10

Sixten Otto