Mac OS X Reference Library Apple Developer Connection spyglass button

Packaging Workflow

PackageMaker (<Xcode>/Applications/Utilities) is the application you use to create installation packages. Figure 2-1 shows the PackageMaker project window. The list following the figure describes the items identified in it.

Figure 2-1  PackageMaker project window

PackageMaker project window

The following sections depict the workflow you should follow when creating installation packages.

Create a PackageMaker Project

A PackageMaker project, the central piece of the your packaging experience, is where you identify a product to be packaged and define the install experience for the users of the product. To create a PackageMaker project, choose:

PackageMaker menu bar: File > New.

PackageMaker displays the Install Properties dialog, shown in Figure 2-2.

Figure 2-2  Install Properties dialog

Install Properties dialog

In this dialog you specify the following package properties:

Identify the Product Components

To define the package’s payload, locate the product components to be included in the package and add them to the Contents pane in the project window. You can add components by dragging them from a Finder window or by choosing:

PackageMaker menu bar: Project > Add Contents.

After adding a second component to a project, PackageMaker creates an install choice for each component you add to the project, unless you add it directly to an existing install choice.

Configure Component Packages

You configure a component package in the component package editor, which contains four panes: Configuration, Contents, Components, and Scripts. They are described in the following sections.

Component Package Configuration Pane

The Component Package Configuration pane (shown in Figure 2-3) is where you specify essential information about the component package and its install experience. The list following the figure describes the items it specifies.

Figure 2-3  Component Package Configuration pane

Component Package Configuration pane

Component Package Contents Pane

The Component Package Contents pane (shown in Figure 2-4) is where you specify the ownership and access permissions of each of the files that make up the component.

Figure 2-4  Component Package Contents pane

Component Package Contents pane
Ownership and access permissions: The files that the Installer application places on the target computer have the same ownership and access permissions of the payload’s files. Therefore, you must set up the owner and access permissions of component files appropriately before building the installation package; otherwise, users may have difficulty manipulating those files after they are installed or Installer may be unable to copy payloads to their destinations.

In most cases, the owner should be root and the group admin. Also, PackageMaker can set the owner, group, and access permissions of the component files to those that work best in Mac OS X, according to the component type.

Component Package Components Pane

The Component Package Components pane (shown in Figure 2-5) specifies whether the component is relocatable or downgradable.

Figure 2-5  Component Package Components pane

Component Package Components pane

A relocatable component is one that may be moved by the user after it’s installed. For example, after installing an application into /Applications, a user with administrator privileges may move it to /Volumes/Family/Applications. When the user installs a relocatable component a second time on the same computer, the Installer application searches for the component’s existing files in additional locations in the file system, not just the location at which the component was installed, according to the Installer package database).

In this pane you also specify whether a component can be downgraded. A downgradable component is one that can be replaced with an earlier version during an install. When the user reinstalls a earlier version of an existing downgradable component, Installer replaces component files that exist in both the payload and the target computer with the ones in the payload and deletes files that are not present in the payload.

Important: A component’s downgradability is specified by the installation package that may downgrade the component, not by the installation package from which the component was installed. And none of this information is kept in the component itself. That is, if an early release of an installation package specifies one of its components as downgradable but a later release deems the same component as not downgradable, after the user installs the later package, they can still downgrade the component using the earlier package.

Component Package Scripts Pane

The Component Package Scripts pane (shown in Figure 2-6) specifies install operations—which are implemented as executable files—to perform before (preinstall) or after (postinstall) the component is installed.

Figure 2-6  Component Package Scripts pane

Component Package Scripts pane
Install effect: The Installer application executes the specified install operation either at the beginning of the install or at the end of the install. But Installer also warns users that it’s about to execute unsecured code when they open the installation package.

Note: Consider defining preinstall and postinstall actions on the product package (see “Product Package Actions Pane”) instead of preinstall and postinstall operation in component packages. The latter are inherently less secure and, therefore, causes the warning described earlier.

Important: In Mac OS X v10.5 clients, the only install operations available are preinstall and postinstall.

For detailed information about install operations, see Software Delivery Guide.

Configure the Product Package

When you select the product package in the package list, the product package editor appears on the right side of the project window. In this editor you define the product’s packaging details and some installation information. The following sections describe the panes in the product-package editor.

Product Package Configuration Pane

The Product Package Configuration pane (shown in Figure 2-7) is where you enter information about the product package, such as its title and description. You can also add other product description files, such as the Welcome, Read Me, License, and Conclusion files (see Software Delivery Guide for details).

Figure 2-7  Product Package Configuration pane

Product Package Configuration pane

This pane also lets you specify which type of install the user can perform on the product package: easy, custom, or both. In addition, you can specify the locations into which the user can install the product: any volume, the system volume, or the user’s home directory.

Product Package Requirements Pane

A package requirement is a test the Installer application performs at the beginning of the installation process. These requirements may be optional. Any unmet, non-optional package requirement prevents the installation process from continuing. Figure 2-8 shows the Product Package Requirements pane, where you specify these requirements. In this case, the package has two requirements, one required and one optional. Their definition and install effects are described in Table 2-1.

Figure 2-8  Product Package Requirements pane

Product Package Requirements pane
Table 2-1  Product package installation requirement examples

Description

Required

Pass if

Install effect

Disk space on target volume is at least 2MB

Yes

true

Prevents install unless destination volume has at least 2MB of free space.

Computer RAM is less than 512MB

No

false

Displays a warning when the computer has less than 512MB of RAM.

Product Package Actions Pane

You may want to tell the Installer application to perform a particular action before or after the product package is installed. Installation actions let you specify such tasks. For example, you can instruct Installer to show the installed payload in a Finder window, as shown in Figure 2-9.

Figure 2-9  Product Package Actions pane

Product Package Actions pane

This postinstall action opens a Finder window displaying one of the installed product’s components.

Configure the Product Package Install Choices

When your product contains multiple components, it may be appropriate to let the user decide which components to install. For example, a particular user of your product may not want to install a documentation or example component. In this case, the user should be able to remove unwanted components from the install process. PackageMaker and the Installer application allow you to define install choices to accomplish such outcome.

Install choices allow users of your product package to customize the install by selecting the components to be installed (unselected components are not installed). For example, if your product includes an application and a user guide as separate components, you may allow the user not to install the user guide by having the application and the user guide under separate choices. In the install customization pane (the Custom Install pane in the Installer application), the user selects the components to be installed.

Note: Install choices are not a mechanism by which installed components can be removed from a computer.

You configure an install choice by selecting it in the Contents pane in the project window and setting values for its properties in the choice editor, which contains two panes: Configuration and Requirements. Figure 2-10 shows the Choice Configuration pane.

Figure 2-10  Choice Configuration pane

Choice Configuration pane

This pane lets you specify the following choice properties:

As described earlier, a choice has user-interface properties that define the level of interaction the user has with the choice in the install customization pane. While you can specify a value for each UI property in the package, there may be choices that need information about the computer to determine the value of such properties. For example, if an optional plug-in component can work only in certain releases of Mac OS X, you may want to display the choice that contains the component only when the computer is running an appropriate operating system version. Here’s where choice requirements can help.

A choice requirement is a test that compares a system property against a value and sets the initial and dynamic values of the choice’s UI properties based on the test result. (The Installer application sets the dynamic values of the UI properties as the user selects or deselects choices in the install customization pane; see Software Delivery Guide for details.) Figure 2-11 shows the choice requirement editor, which lets you define the test and the resulting values of the choice UI properties if the test fails.

Figure 2-11  Choice requirement editor

Choice requirement editor

Build the Product Package

To build the package, choose:

PackageMaker menu bar: Project > Build.

A dialog appears asking for the name and location of the package.

Open the generated installation package in the Installer application and ensure that the resulting install experience is what you expect and that your product is installed correctly. You should perform comprehensive tests involving as many of the system configurations your product supports as possible. See Software Delivery Guide for more information.



Last updated: 2009-01-06

Did this document help you? Yes It's good, but... Not helpful...