PATH Contents > Defining Installation Requirements and Scripts
Defining Installation Requirements and Scripts

This document describes the Requirements and Installation Scripts that can be defined to check if a component can be installed on the machine or a specific volume and which scripts shall be run before and after the installation of the files of the component.

Finally, this document describes how to add resources, for instance used by an Installation Script, in a component.

Managing Installation Requirements

By default, when you install a component, it can be installed on any Macintosh running Mac OS X and on any of its partitions (as long as the option Root Volume Only is not enabled).

Installation Requirements can be used to decide if a component can be installed with the currently running operating system and installed applications or on which partition.

There are two possible levels for a Requirement:

Important: Requirements are only checked by Installer on Mac OS X 10.3 and later. If you need to check things on previous Mac OS X releases, you will want to use InstallationCheck or VolumeCheck scripts.

To add an installation requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Configure the Requirement.
5Click OK.

To edit an installation requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the Requirement in the list.
4Click Edit… in the Requirements section.
5Modify the Requirement.
6Click OK.

To remove an installation requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the Requirements to be removed.
4Click - in the Requirements section.
5Click Remove.

To enable or disable an Installation Requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the Requirement.
4Select or unselect the checkbox in the MemberShip (•) column.

To change the level of an installation requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the Requirement.
4Choose the level from the pop-up menu in the Level column.

Configuring Installation Requirements

There are two kinds of Requirement. Those evaluated at the very beginning of the installation and which decide whether the installation is allowed on the current operating system or not. And those evaluated during the Select Destination step and which decide whether the installation can be performed or not on a specific available partition.

Here is the description of Requirements supported by Iceberg:

A Requirement is defined by the following items:

To add a Package requirement:

1Select the metapackage in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Type the label of the Requirement in the Label text field.
5Choose the level from the Level pop-up menu.
6Choose Package from the pop-up menu in the upper left corner of the Specificaiton section.
7Type the Bundle Identifier (CFBundleIdentifier) of the package in the Bundle Identifier text field.
8Choose the Info.plist file key from the key pop-up menu.
9Choose the comparator method from the comparator pop-up menu.
10Type the comparison value in the text field in the lower right corner of the Specification section.
11Type the title of the alert in the Title text field.
12Type the message of the alert in the Message text field.
13Click OK.

To add a Gestalt requirement:

1Select the metapackage in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Type the label of the Requirement in the Label text field.
5Choose the level from the Level pop-up menu.
6Choose Gestalt from the pop-up menu in the upper left corner of the Specificaiton section.
7Type the Gestalt identifier in the text field or choose it from the pop-up menu.
8Choose the comparator method from the comparator pop-up menu.
9Type the comparison value in the text field in the lower right corner of the Specification section.
10Type the title of the alert in the Title text field.
11Type the message of the alert in the Message text field.
12Click OK.

To add a sysctl requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Type the label of the Requirement in the Label text field.
5Choose the level from the Level pop-up menu.
6Choose sysctl from the pop-up menu in the upper left corner of the Specificaiton section.
7Type the sysctl identifier or choose one from the pop-up menu.

Note: The full list of sysctl identifiers can be displayed by running sysctl -a in Terminal.

8Choose the comparator method from the comparator pop-up menu.
9Type the comparison value in the text field in the lower right corner of the Specification section.
10Type the title of the alert in the Title text field.
11Type the message of the alert in the Message text field.
12Click OK.

To add a Bundle requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Type the label of the Requirement in the Label text field.
5Choose the level from the Level pop-up menu.
6Choose Bundle from the pop-up menu in the upper left corner of the Specificaiton section.
7Choose "doesn't exist" from the location pop-up menu to check for the absence of the bundle or "located" to check the value for a key of the bundle Info.plist file.
8Type the absolute path name to the bundle in the location texte field and go to step 12 if you have chosen "doesn't exist".
9Choose the Info.plist key in the key pop-up menu.
10Choose the comparator method from the comparator pop-up menu.
11Type the comparison value in the text field in the lower right corner of the Specification section.
12Type the title of the alert in the Title text field.
13Type the message of the alert in the Message text field.
14Click OK.

To add a file requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Type the label of the Requirement in the Label text field.
5Choose the level from the Level pop-up menu.
6Choose File from the pop-up menu in the upper left corner of the Specificaiton section.
7Choose "doesn't exist" from the location pop-up menu to check for the absence of the file or "located" to check an attribute of the file.
8Type the absolute path name to the file in the location text field and go to step 12 if you have chosen "doesn't exist".
9Choose the file attribute from the attribute pop-up menu.
10Choose the comparator method from the comparator pop-up menu.
11Type the comparison value in the text field in the lower right corner of the Specification section.
12Type the title of the alert in the Title text field.
13Type the message of the alert in the Message text field.
14Click OK.

To add a Property List requirement:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Requirements section.
4Type the label of the Requirement in the Label text field.
5Choose the level from the Level pop-up menu.
6Choose Property List from the pop-up menu in the upper left corner of the Specificaiton section.
8Type the absolute path name to the Property List in the location text field
9Choose the value kind from the type po-up menu.
10Choose the Property List key from the key pop-up menu.
10Choose the comparator method from the comparator pop-up menu.
11Type the comparison value in the text field in the lower right corner of the Specification section.
12Type the title of the alert in the Title text field.
13Type the message of the alert in the Message text field.
14Click OK.

To add an alert localization:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the requirement in the Requirements list.
4Click Edit… in the Requirements section.
5Choose Add Localization… from the localization pop-up menu.
6TYpe the name of the localization and click Add.
7Type the localized title of the alert in the Title text field.
8Type the localized message of the alert in the Message text field.
9Click OK.

To change an alert localization:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the requirement in the Requirements list.
4Click Edit… in the Requirements section.
5Choose the localization from the localization pop-up menu.
6Change the alert title or message.
7Click OK.

To remove an alert localization:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the requirement in the Requirements list.
4Click Edit… in the Requirements section.
5Choose the localization to be removed from the localization pop-up menu.
6Choose Remove… from the localization pop-up menu.
7Click Remove.
8Click OK.

Defining Installation Scripts

By default, when a component is installed, no tasks is peformed before or after the installation. If needed, you can define scripts (for instance shell or perl scripts) that will be executed before or after the installation.

You can define six types of scripts:

Important: InstallationCheck and VolumeCheck scripts are not managed by the Installation Scripts section. If you want to use such script, use the Addtional Resources section.

To add an installation script:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the type of script you wish to add in the Installation Scripts list.
4Click Choose… in the Installation Scripts section.
5Select the file you want to use for this script and click Choose.

Note: By default, the references are absolute path names. You can switch to relative path names using the local menu of the text field.

6Select the checkbox of the selected script in the Membership (•) column.

To enable or disable an installation script:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Select the Installation Script.
4Select or unselect the checkbox in the Membership (•) column.

Adding Additional Resources

If you wish to use an InstallationCheck or VolumeCheck or one of the Installation Scripts requires additional files, you can add these using the Additional Resources list. By default, they will be added into the Resources folder of the component. If you need it, you can create localized Additional Resources.

Note: If you want to use an InstallationCheck or VolumeCheck scripts, add them to the International localization of the Additional Resources. Their permissions will be checked and modified if needed when the component is built.

To add an additional resource:
1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Click + in the Additional Resources section.
4Select the items you want to add and click on Add.

Note: By default, the references are absolute path names. You can switch to relative path names using the local menu in the Reference column.

To remove an additional ressource:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
2Select the items you want to remove from the list of Additional Resources.
4Click - in the Additional Resources section.
5Click Remove.

Note: Files or folders are not deleted from the disk, only the references in the project are.

To enable or disable an additional resource:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
2Select the item in the Additional Resources list.
4Select or unselect the checkbox in the Membership column.

To add a Resources localization:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Choose Add Localization… from the localization pop-up menu.
4Type the localization name and click Add.

To remove a Resources localization:

1Select the component in the Packages & Metapackages list.
2Choose View > Scripts.
3Choose the localization from the localization pop-up menu.
4Choose Remove… from the localization pop-up menu.
5

Click Remove.

Note: Files or folders are not deleted from the disk, only the references in the project are.


Author: Stéphane Sudre