This is a summary of the information on older (buundle-type) OSX installers in the software delivery legacy guide.
This redux might help reading the original document, because I found the original hard to digest.
The world the legacy guide describes is for standard packaging up to and including OSX 10.4.
In this world, all installation packages were bundles. To quote from the glossary of the legacy guide:
- bundle
- A structured directory hierarchy that stores files in a way that facilitates their retrieval.
This means all installation package types before OSX 10.5 are directories with a particular structure. These are the package types described in the legacy guide, and this document. Newer OSX will still install from these packages.
In the new world (OSX 10.5 and above), the standard package formats are flat, meaning that the packages are archived up into single file xar archives. There are two types of packages in this new world of flat:
See OSX flat packages for details.
Now we forget about flat packages and go back to the world where all installer packages are bundles.
The software delivery guide distinguishes between:
The rest of this document is about managed installs.
There are two categories of installers, single component installers and multi-component installers. A single component installer can only have one component, but the multi-component installers can contain more than one component.
I will use installer and package to mean the same thing in this document. Both single and multi-component packages can be used as installers.
There is only one type of single-component installer – the component package.
There are two types of multi-component installers; metapackages and distribution packages (see below).
Therefore there are three types of installers / packages:
The Apple term for a package / installer for a single component is a component package. Component packages can be used as installers, or as units for building multi-component packages.
A component package carries information and data for installing one particular component. A component package:
This is one .pkg compoenent bundle from the Python.org installer:
There are two types of multi-component packages, the metapackage and the (newer) distribution package.
A metapackage:
Here’s is the .mpkg bundle for the Python.org installer:
Each of the listed .pkg component packages is also a bundle. In fact the example component bundle contents is the contents of PythonUnixTools-2.7.pkg from the Python.org .mpkg bundle here.
A distribution package:
This is the contents of a distribution package I had lying around on my hard drive:
Confusingly, it is also possible to make a package that is both a metapackage and a distribution package. These packages have the contents of a metapackage, but with the extra distribution.dist file. The installer runs as a metapackage on OSX < 10.4, and as a distribution package for OSX >= 10.4. For example, this is why the metapackage and distribution package directory listings shown in the MacTech flat package article have the same files.
Apple distinguishes four types of information any package can contain:
Install operations are operations run during the steps of an install, that can customize the behavior of the installer.
I’ll also call these pre / post operations.
The operations are run in the following order (see Steps in an install).
There follows the install / payload drop step (above), then:
All these operations are optional.
The executables can be scripts or binaries, but must have their executable bit set.
See “Specifying install operations” in the software delivery legacy guide.
Component packages, metapackages and distribution packages differ in their behaior when isntalling. They differ in the way they implement requirement checks and which operation executables they run.
A component package can have none or more of the following executables:
These scripts implement requirement checking for the “requirements check” step (Steps in an install).
If InstallationCheck is present, it should return 0 if the system is suitable for the install. If not, it should return another number, where the number identifies a message to display (see the software delivery legacy guide for details).
If VolumeCheck is present, it should return 0 for any volume that is suitable for the install. If a particular volume is not suitable, it should return another number, where the number identifies a message to display (see the software delivery legacy guide for details). The installer will run VolumeCheck on each available volume at install-time.
An install using a component package also runs these (optional) operations / executables:
A metapackage can contain:
I will call the containing metapackage the “top metapackage”.
The metapackage cannot implement its own installation or volume requirement checking, and only uses the checks of the component packages.
Distribution packages can only contain component packages, not metapackages or other distribution packages.
Distribution packages implement their requirement checks with javascript code embedded in an XML file called distribution.dist. This file can contain javascript code for checking whether the system is suitable for the install (the Installation Check script) and code for checking whether a volume is suitable for install (the Volume Check script). The requirements check process is therefore:
Unlike the metapackage, the distribution package cannot itself specify pre-post operations with scripts (they will be ignored if present).