Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What will be better way to create a distributable file for Mac OS, DMG or pkg?

share|improve this question
add comment

7 Answers 7

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.

share|improve this answer
1  
Realistically, preference panes don't need any installers; if there's a pref pane on a disk image, and the user double-clicks it, OS X is smart enough to know that it needs to be installed, and even asks the user if it should be installed for all users or just the account logged in (/Library/Preference Panes/ or ~/Library/Preference Panes/). –  delfuego Nov 19 '09 at 18:51
    
I agree with your comment. But let's be realistic that many of these do include installers. I'll edit my response -- I was trying to think of things which need PKGs. –  Geoff Hutchison Nov 20 '09 at 15:06
add comment

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

share|improve this answer
add comment

Disk image if installing is as simple as drag-and-drop, package installer if you need to install supporting files outside of the app bundle.

Also note that with a disk image, it's a good idea to offer to install the app for the user if they run the program from the image. Otherwise some people will never actually install the program and just keep the disk image around forever.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

DMG

Outdated, if you ask me.

They've got several problems

  • Users don't know what to do with them. Even though many developers put a background image there explaining it I don't think users know what to do.

  • After copying the Application to its folder the .dmg stays in the Downloads folder.

  • Can be quite complicated to set up properly.

  • Can take a long time to mount.

PKG

Only for applications that need to install part of itself with elevated permissions.

  • Users associate packages with applications that need special permissions and are therefore less likely to install the app.
  • It's not obvious to the user how to remove the app.

ZIP

  • Gives a nice icon in the Downloads folder.
  • Drag & drop into the application folder is quite intuitive.
  • Standard file formats are always nice.
share|improve this answer
add comment

If you can create drag and drop DMG file then it will be better. Most of software for Mac OS uses distributable DMG. first u have to create application file(.app) then u have to create DMG file using Disk Utility. But I donot know how to create drag and drop DMG.

DMG is better approach for you software than Packaging (.pkg)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.