Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Packaging Basics

There are two main applications for compressing your application: Disk Utility (or Disk Copy in older versions of Mac OS X) and PackageMaker. Disk Utility allows you to create compressed disk images, while PackageMaker creates packages that can be installed using the Mac OS X installer.

The recommended form of application distribution is a compressed disk image. A compressed disk image preserves resource forks that may be present, allows drag-and-drop installation, allows license display, and even allows encryption of data, if required.

If your application is a single application bundle, simply put it and any relevant documentation on a disk image with Disk Utility, then compress it and distribute it.

If you have an application that requires administrator privileges to install into privileged directories or requires more than a simple drag-and-drop installation, use PackageMaker (/Developer/Applications/PackageMaker) to build installer packages for Apple’s Installer application.

The basics of using Disk Utility to make a disk image are given in the next section. For help using PackageMaker, choose PackageMaker Help from the PackageMaker Help menu.

Disk Utility (or Disk Copy)

The following steps help you package your application as a disk image (.dmg file) for distribution on Mac OS X.

  1. Open /Applications/Utilities/Disk Utility.app by double-clicking it.

  2. From the Image menu, choose New Blank Image. Disk Utility opens a new window with customization options as in Figure 8-1.

  3. In the “Save as” text box, enter the name of the compressed file that you will distribute. By default, a.dmg suffix is appended to the name you enter. Although it is not required, it is a good idea to retain this suffix for clarity and simplicity.

  4. In the Volume Name text field, enter the name of the volume that you want to appear in the Finder of a user’s computer. Usually this name is the same as the name of the compressed file without the .dmg suffix.

  5. In the file browser, set the location to save the file on your computer. This has nothing to do with the installation location on the end user’s computer, only where it saves it on your computer.

  6. Set the Size pop-up menu to a size that is large enough to hold your application.

  7. Leave the Format set to Mac OS Extended (the HFS+ file format).

  8. Leave Encryption set to none. If you change it, the end user must enter a password before the image can be mounted, which is not the normal way to distribute an application.

  9. Click Create.


Figure 8-1  Disk Utility options

Disk Utility options

Once you have a disk image, mount it by double-clicking it. You can now copy your files to that mounted image. When you have everything on the image that you want, you should make your image read-only. Again from Disk Utility, perform these steps:

  1. Unmount the disk image by dragging the volume to the Trash, clicking the eject button next to the device in a Finder window, or selecting the mounted volume and choosing Eject from the Finder’s File menu.

  2. Choose Convert Image from the Image menu.

  3. In the file browser, select the disk image you just modified and click Convert.

  4. Choose a location to save the resulting file, change the image format to read-only, and click Convert.

You now have a disk image for your application that is easy to distribute.



< Previous PageNext Page > Hide TOC


Last updated: 2008-04-08




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice