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
CFBundleShortVersion, and possibly the
payload-free.pkg/Contents/Resources/en.lproj/Description.plist – edit the
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).