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).
[…] do your modifications in an easy-to-deploy pkg installer. See Greg Neagle’s (Creator of Munki)blog post on creating payload free […]
[…] packages were created using the payload-free-package-template by Greg Neagle < munki, packaging > « Managing Zabbix Agents with […]
[…] packages were created using the payload-free-package-template by Greg Neagle < munki, packaging > « Managing Zabbix Agents with […]
[…] You can then push this command out using Apple Remote Desktop, run it over SSH, install it with a payload-less package or even have something like Munki run the script for you. On the 318 Tech Journal, William […]
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?
Please ignore this, I got it to work. Seemed like a permission issue. Simon
[…] DeployStudio and Munki cannot currently install profiles themselves, a payload-free package should be created with it, using this command to install as a device […]
[…] Managing OS X – Payload Free Package template […]