Payload-free package template

Payload-free packages are packages that exist only to run scripts. These are typically scripts you need to run a single time to perform a configuration task. They don’t install any files, thus the name “payload-free”. They are useful in workflows where you are installing packages like InstaDMG or any of the software distribution mechanisms that use packages. You can wrap your script into a payload-free package, and use the same mechanism you use to install software to deliver and run your script.

Here is a template payload-free package you can use to create custom payload-free packages for your own use.

To use it, duplicate it, rename it, and edit the following files:

payload-free.pkg/Contents/Info.plist – edit the CFBundleIdentifier, CFBundleShortVersion, and possibly the IFPkgFlagRestartAction.

payload-free.pkg/Contents/Resources/en.lproj/Description.plist – edit the IFPkgDescriptionDescription and IFPkgDescriptionTitle. Repeat for other languages if desired.

payload-free.pkg/Contents/Resources/postflight – put your script here. Make sure it’s marked as executable and starts with an appropriate “she-bang” line (#!/bin/sh or similar).

Payload-free package template

8 thoughts on “Payload-free package template

  1. Simon says:

    Hi Greg, I was wondering if you can help me fix the issue. I followed all the the steps to test a tiny script to see it in action [pmset -a disksleep 0]. However, when I run the package it does not seem to work although if I run the script ./postflight manually, it works.

    Any idea?

Comments are closed.