About Distributions
A distribution (.mpkg) is similar to a metapackage in that it bundles multiple items together into a single install. However, a distribution offers more flexibility in specifying the interface for your installer. This flexibility is provided by a distribution script, which is XML combined with JavaScript. For a full description of all XML elements and JavaScript objects, see the Installer Release Notes.
A distribution script consolidates the information previously scattered across many files within an mpkg, such as: InstallationCheck, VolumeCheck, IFRequirements, IFPkgFlagPackageSelection, IFPkgFlagPackageList, IFPkgFlagRootVolumeOnly, IFPkgFlagRestartAction, IFPkgFlagDefaultLocation, IFPkgFlagAuthorizationAction, IFPkgFlagBackgroundAlignment, IFPkgFlagBackgroundScaling, and many others.
Using a distribution script to replace your InstallationCheck tool or script with a JavaScript equivalent removes the “This Installer package needs to run a program to determine if it can be installed.” sheet. The JavaScript in the distribution script lets the package author script the InstallationCheck, VolumeCheck, and Installer.app interface. The JavaScript runs in a custom run-time.
More Info…
The packages bundled with a distribution can be inside the distribution, on the same level as the distribution, on removable media, or at a custom location.
More Info…
A distribution (with extension .mpkg) is an OS X bundle, meaning that it appears as a single file in the Finder, but is really a directory. The structure of a distribution is as follows:
- Foo.mpkg
- Contents
- distribution.dist
- Packages
- a.pkg
- b.pkg
- c.pkg
- Resources
- Localized resources in .lproj directories
- Scripts
- Other resources
The italicized items can be created by PackageMaker. The package author is responsible for all other items.