< Previous PageNext Page > Hide TOC

Legacy Documentclose button

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


Installs and Upgrades

During installation, Installer creates a package file with the same name as the package being installed to serve as an installation receipt. The receipt serves as a record for an installation and contains the same information that was in the installation package, except for the archive of the software to be installed. That information includes a .bom file, which contains, in binary format, a list of the files that were actually installed. Installer stores the receipt in /Library/Receipts on the installation volume, creating the directory if it does not already exist.

Installer uses the presence or absence of a receipt on the installation volume to determine whether an installation is an install or an upgrade. That is, Installer assumes software is being installed for the first time if there is no receipt with the same name as the package being installed. If there is such a receipt, the installation is an upgrade.

Contents:

How Installer Handles Installs and Upgrades
Installs and Upgrades With Metapackages


How Installer Handles Installs and Upgrades

An installation, or install, is treated differently than an upgrade in the following ways:

  1. Installer shows the appropriate text (“Install” versus “Upgrade”) to the user.

  2. For an upgrade, if the package supplies appropriate version information, Installer may need to replace only certain outdated files, and may remove previously installed files that are not part of the current installation.

    For details on how Installer determines which files to install and remove during an upgrade, see “Specifying Version Information for Packaged Software.” And for related information, see “Finding Previously Installed Software.”

  3. Depending on the contents of the package, Installer may execute different scripts as part of the installation. For example, for an install it will execute preinstall and postinstall scripts, if present; for an upgrade, it will execute preupgrade and postupgrade scripts, if present. (It always executes preflight and postflight scripts, if present.) These scripts are described in “Modifying an Installation With Scripts.”

Important: Installer does not currently support uninstalling software, although during an upgrade, it will remove previously installed files that are not part of the current installation.

That is, after the Installer has determined an upgrade is being performed, it will compare the names of files in the previous install (from the receipt) against the names of files currently chosen to be installed and remove any files not in the new install.

Installs and Upgrades With Metapackages

When a user installs packages from a metapackage, Installer stores a receipt for each package the user installs, but not for the metapackage itself. In the Custom Install pane for a metapackage, Installer will show which packages are installs and which are upgrades, based on the presence or absence of receipts for the individual packages.

A metapackage itself is considered an install only if all of the packages are installs; if any package is an upgrade then the metapackage is also considered an upgrade (and the button is labeled Install or Upgrade accordingly). The install or upgrade status of the metapackage determines which preinstall, preupgrade, postinstall, or postupgrade scripts in the metapackage are executed (if any are present). Preinstall and preupgrade scripts for a metapackage are run before any package is installed; postinstall and postupgrade scripts are run after all packages have been installed.

Install and upgrade scripts for an individual package in a metapackage are executed according to the install/upgrade status of the package. Preinstall and preupgrade scripts for an individual package are run before the package is installed; postinstall and postupgrade scripts are run afterwards.

For more information on which scripts are executed and when, see “Execution Order for a Complex Metapackage.”



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