Description
Packages with a post-install script can be useful when a deployment requires certain files to be in place alongside the package. This article provides the steps to create a package with a post-install script using Composer which can be deployed with Jamf School.
Creating Packages with Post-Install Scripts using Composer
Open Finder and click Go in the upper-left corner of the menu bar.
Click Go to Folder and open /private/tmp.
Create a new folder, giving it the desired name.
Drag the needed pkg into the new folder along with any additional files needed for the deployment.
Open Composer and drag the folder from Step 3 into the left side bar in Composer; this should create a new Source.
Verify the /private/tmp directories exist and all necessary files are included
Set desired Owner and Group for the folders by selecting the desired setting from the dropdown boxes. Click on the private directory, then click on the dropdown boxes for Owner and Group to set Owner as root (0) and Group as wheel (0) if they are not.
Click the three dots on the bottom right, click Apply Owner and Group to private and All Enclosed Items and also "Apply Permissions to private and All Enclosed Items".
To add the post-install script:
Click on postinstall on the left and complete the steps below:
Delete everything below #!/bin/sh
Add the command below, changing the /path/to/file to
/private/tmp/foldername/packagename
and /DesiredInstallPath to the location you want the package to install on the target computers
installer -pkg /path/to/file -target /DesiredInstallPath
.
Click Build as PKG and save it to the desktop.
Upload the package to Jamf School:
Go to Apps > Inventory.
Click Add App and choose Add In-House macOS Package.
Select the package or drag and drop the package to the pop up window.
Wait for the package to upload. You will be automatically redirected to the created package record after the upload has completed.
Click the + button at the bottom of the page to add a device group to the scope.
Click Save.