Preparing the wrapper package folder structure

This section outlines the folder structure that the wrapper package is built from.

The wrapper package works by placing both original files into a staging folder inside its payload, then running a postinstall script that copies them to a temporary location, runs the WebsenseEndpoint installer, and cleans up afterward.

Steps

  1. On the build macOS endpoint, create the folder structure:
    mkdir -p ~/wrapper/scripts
    mkdir -p ~/wrapper/payload/private/tmp/websenseendpoint_install
  2. Copy the two installer files into the staging folder:
    cp /path/to/WebsenseEndpoint.pkg ~/wrapper/payload/private/tmp/websenseendpoint_install/
    cp /path/to/manifest.json        ~/wrapper/payload/private/tmp/websenseendpoint_install/

Result

The folder structure is used as follows:

  • wrapper/payload — this becomes the file system content that pkgbuild will install onto the target macOS endpoint.
  • private/tmp/websenseendpoint_install — a temporary staging location. Using /private/tmp keeps the staged files out of the way of any permanent application folders and makes cleanup straightforward.
  • wrapper/scripts — holds the postinstall script that pkgbuild will embed and run automatically once the payload has been laid down.