< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.


Anatomy of a Package

This section provides a detailed description of the contents of a complex installation package. It assumes you are familiar with the information in “About Packages,” which introduces packages and describes the contents of a simple package.

Important: This section describes the format for a package created with PackageMaker version 1.1.10 or later. Version 1.1.10 first shipped with the December 2002 Developer Tools CD.

An installation package is actually a directory, with extension .pkg, that is presented to the user as a file. You create a package with PackageMaker. The information you supply through its user interface is stored in the package. This process is described in detail in “Creating a Package.”

Double-clicking a package launches Installer. The package contains all the information Installer needs to take a user through the process of installing the packaged software.

A package has a well-defined format, with required and optional subdirectories and files. To display the contents of an installation package (or any other directory displayed in the Finder as a single file), Control-click the file and choose Show Package Contents from the contextual menu.

Note: You can display the contents of a package in a Terminal window with the find command. For an example, see Listing 2.

Contents:

High-Level Package Structure
Localized Folder Names
A Complex Installation Package
Additional Package Files


High-Level Package Structure

Every installation package contains one directory at the highest level, named Contents. Within that directory, all packages contain several files and a Resources directory, as shown in Listing 1. The filenames are always the same, except that if the archive file is not compressed, it does not have the .gz extension.

The files at the highest level in the package contain the software to install and information about where to install it (Archive.bom and Archive.pax.gz), as well as information about the installation (Info.plist). The PkgInfo file provides backward compatibility with previous versions of Installer.

Listing 1  Files and directories in a package’s Contents directory

Archive.bom
Archive.pax.gz
Info.plist
PkgInfo
Resources

The structure of the Resources directory is also fairly straightforward. It contains a relatively small number of files, and may also contain one or more localized directories. A Resources directory can contain these kinds of files:

A Resources directory’s localized directories, such as French.lproj and English.lproj, can contain the following:

Less commonly, a package can contain the files described in “Additional Package Files.”

All of these files are described in more detail in the following sections.

Localized Folder Names

You can use any of the folder names shown in Table 1 to create localized folders in the Resources folder in a package. If you construct other folder names from the ISO 639 standard for language codes and the ISO 3166 standard for country codes, they may not be recognized by Installer when installing your package.

Table 1  

Localized folder names

Dutch.lproj

English.lproj

French.lproj

German.lproj

Italian.lproj

Japanese.lproj

Spanish.lproj

da.lproj

fi.lproj

ko.lproj

no.lproj

pt.lproj

sv.lproj

zh_CN.lproj

zn_TW.lproj

A Complex Installation Package

Figure 1 shows the contents of a complex package that contains examples of all the types of files a package typically contains, except those described in “Additional Package Files.” You can create a package like this one by following the steps in “Creating a Package.” These files and directories include:

The package’s Resources directory contains the following files:


Figure 1  The contents of a complex installation package

The contents of a complex installation package

Additional Package Files

In addition to the files described in “A Complex Installation Package,” a package may also contain the following files:



< Previous PageNext Page > Hide TOC


© 2003, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-24)


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.