PATH Contents > Defining the items installed by a package
Defining the items installed by a package

The package Payload tab let you define what and where files or folders should be installed.

Package Settings

To access the Payload tab of a package of a distribution project:

1Select the package in the source list
2Click the Payload tab.


Changing the default destination of a package

The default destination is the location where Installer will install the items from the payload.

This is also the starting point that will be used by Packages to build the payload from the file hierarchy. You can spot the default destination in the hierarchy from its icon representing a folder with a red reticle over it.

Default Destination

By default, the default destination is set to be /. In 99.99% of cases, you won't need to change it.

To change the default destination:

1Select the folder for the default destination in the file hierarchy.
2Click on the Set button.


Managing the file hierarchy

The Payload file hierarchy looks like the "View as List" mode of the Finder and it works the same way. You can add items, arrange them, rename some of them, etc.

Payload Hierarchy

The file hierarchy can contain the following 3 types of items:

TypeDescription
Standard folderA standard folder represents a folder from the standard Mac OS X file hierarchy.

A standard folder can be neither moved, removed nor renamed.

File system itemA reference to a real file or folder on disk.

A file system item can be moved and removed. It can not be renamed.

Custom folderA folder that does not exist on disk.

A custom folder can be moved, removed and renamed.

Elastic folderA folder that does not exist on disk and can represent a series of enclosed folders.

An elastic folder can be moved, removed and renamed. Available when the Advanced Options are enabled.


Notes:
  • As long as a standard folder relative hierarchy does not contain a custom folder or file system item, the standard folder icon will be drawn as dimmed and the standard folder will not be included in the payload during the build process.

  • You can display/hide additional standard folders by choosing Hierarchy > Show Hidden Folders or using the shortcut ⌘ .

  • If the folder you're looking for is not displayed even with the additional standard folder, add the relevant folders as custom folders.

To add a file system item to the file hierarchy:

1Select the folder in which you want to insert a new item.
2Click the + button of the file hierarchy or choose Hierarchy > Add Files…
3Select the file or folder you want to add.
4Choose whether you want to keep the owner and group of the item on disk and which reference style should be used.
5Click Add.

Notes:
  • You can also add files and folder by drag and dropping them from the Finder to the file hierarchy.

  • Drag and dropping an application or bundle in the Contents pane instead of directly in the file hierarchy invokes the smart location detection which will add the application or bundle at the most appropriate location in the file hierarchy.

To add a custom folder to the hierarchy:

1Select the folder in which you want to insert a new item.
2Choose Hierarchy > New Folder.
3Type the name of the folder and validate with Return.

To add an elastic folder to the hierarchy:

1Select the folder in which you want to insert a new item.
2Choose Hierarchy > New Elastic Folder.
3Type the name of the folder and validate with Return.

Note: Use the '/' file path separator to separate enclosed folders. e.g. myFolder/mySubfolder.

To remove items from a file hierarchy:

1Select the items in the file hierarchy.
2Click the - button of the hierarchy or choose Edit > Delete.
3Click Remove.

Note: The item will only be removed from the file hierarchy, it will not be removed from disk.

To reorder the items in the file hierarchy:

1Select the items in the file hierarchy.
2Drag and drop them to the new location in the hierarchy.

By default, when you add a reference to a real folder in the file hierarchy, its contents is not disclosed in the hierarchy.

To reveal the contents of a referenced folder:

1Select the referenced folder in the file hierarchy.
2Choose Hierarchy > Expand > Fully.

Notes:
  • You can also reveal only the contents of the first level of a referenced folder.

  • Usually, it is not recommended to reveal the contents of a bundle (.app, .framework). Definitely not recommended if the bundle is codesigned.

  • Not revealing the contents of a folder can also be useful to be able to change the contents of the real folder on disk without having to update the Payload file hierarchy in Packages.

  • When the contents of a folder is not revealed in the file hierarchy, all the items within this folder will be part of the payload; the owner and group for these items will be set to the ones of the folder. The permissions will be the ones of the referenced items on disk.

  • When you disclose the contents of a folder, the owner and group of the disclosed items are set to the ones of the folder. To keep the owners and groups of the referenced items on disk, you need to hold down the alt key when you choose Archive > Expand > One level or Fully.


Changing the attributes of an item

The inspector pane on the right of the file hierarchy displays the attributes of the selected item(s) in the file hierarchy.

Payload Inspector

The inspector contains the following information:

ValueDescription
IconThe icon for the file or folder as displayed in the Finder.
NameThe name of the file or folder.
Modification DateThe date of the last modification for the file or folder.
ArchitecturesArchitectures supported by the executable if an executable is selected.
TypeThe type of the item: a file, folder or custom folder.
ReferenceThe reference style for the item.
SourceThe relative or absolute path of the item on disk.
DestinationThe location where the item will be installed on disk.
OwnerThe owner for the item after it's installed on disk.
GroupThe group for the item after it's installed on disk.
AccessThe access permissions for the item after it's installed on disk.

To rename a custom folder:

1Select the custom folder in the file hierarchy.
2Type the new name of the folder in the Name text field of the inspector.
3Validate with Return.

To change the reference style of an item:

1Select the item in the file hierarchy.
2Choose the new style from the Reference popup button.

To change the owner of an item:

1Select the item in the file hierarchy.
2Choose the new owner from the Owner popup button.

To change the group of an item:

1Select the item in the file hierarchy.
2Choose the new group from the Group popup button.

Note: In 95% of cases, the owner of an item should be root and the group should be wheel or admin. If you set the owner and group to a specific user account and staff, you are probably doing something wrong.

To change the access permissions of an item:

1Select the item in the file hierarchy.
2Choose the new group from the Group popup button.

Notes:
  • Do not play with the Bit column if you don't know what you are doing.

  • In 99.99% of cases, setting the SetUID (setuid) bit is a bad idea from a security point of view.


Defining rules for bundles

When a bundle (an application or a plugin) is selected, the rules attributes are available.

Bundle locators

By default, it is not possible to install an older version of a package over a newer one.

To allow/forbid an older version of a package to be installed over a newer one:

1Select the bundle in the file hierarchy.
2Click the Rules tab in the inspector.
3Click the Allow Downgrade checkbox.

By default, when a bundle, typically an application, is installed, it will be installed at the location defined in the hierarchy. If a previous version of the application was installed and then moved by the user, there will be two versions of the application disk.

It is possible to look for a previous version of a bundle during the installation and replace it with the version in the package. This is done with locator rules.

The following type of locator are supported:

TypeDescription
StandardLook for previous versions based on the identifier and default location of the bundle.
JavaScriptWrite your own locator code in JavaScript.
You can add your own locator types using plugins you developed.

To add a locator:

1Select the bundle in the file hierarchy.
2Click the Rules tab in the inspector.
3Click the + button of the locators list.
4Choose the type of locator from the popup button.
5Customize the locator settings.
6Click OK.
7Type the name of the locator and validate with Return.

To remove one or multiple locators:

1Select the bundle in the file hierarchy.
2Click the Rules tab in the inspector.
3Select the locators you want to remove.
4Click the - button.
5Click Remove.

To edit a locator:

1Select the bundle in the file hierarchy.
2Click the Rules tab in the inspector.
3Select the locator.
4Click Edit…
5Make the changes you want in the locator editor.
6Click OK.

To disable/enable a locator:

1Select the bundle in the file hierarchy.
2Click the Rules tab in the inspector.
3Select the locator.
4Click the checkbox on the left of the locator name.

To rename a locator:

1Select the bundle in the file hierarchy.
2Click the Rules tab in the inspector.
3Select the locator.
4Click the name of the locator.
5Type the new name and validate with Return.

Notes:
  • When multiple previous instances of a bundle are found, the first one will be used.
  • Instances of a bundle that are not on the target disk of the installation will not be found. This is an implementation detail of Mac OS X that may change in the future.
  • A JavaScript locator function may take zero or more parameters. The values of the parameters are defined by you.
  • A JavaScript locator function should return a string or an array of strings. Each string is a suggested location for the installation of the bundle. The location is an absolute path that includes the name of the bundle.


Defining pre- and post-installation scripts for bundles

When a bundle (an application or a plugin) is selected, the Scripts attributes are available.

Bundle scripts

It is possible to attach scripts that should be run before or after a bundle is installed.

To set a pre- or post-installation script:

1Click the appropriate Set… button.
2Select the script you want to use.
3Click Set.

To remove a pre- or post-installation script:

1Click the appropriate Remove… button.
2Click Remove.




Revision History
10/22/19Add some notes regarding default install location and standard folders.
08/12/10Added some notes regarding JavaScript locator functions parameters and output.
05/16/10First version

Copyright 2010-2019 Stéphane Sudre. All rights reserved.