Payload-Free Package

I do a lot of work with payload-free packages and I’ve looked for a while for a tool that would let me easily create them from existing scripts. While I have a process for creating them as needed with pkgbuild, this approach still requires some setup work.

Payload-Free Package Creator logo

After thinking about it and taking a look at various approaches, I’ve developed Payload-Free Package, an Automator application that will allow the selection of an existing script and create a payload-free package that runs the selected script. For more details, see below the jump.

Using Payload-Free Package

1. If needed, download the file from the application directory in my GitHub repo.

2. Once downloaded and unzipped, double-click on the Payload-Free Package Creator application.

Screen Shot 2014-03-07 at 5.35.57 PM

3. You’ll be prompted to select the script that you want to create a payload-free package from.

Screen Shot 2014-03-07 at 7.33.43 PM

4. Once you’ve selected the script, you’ll be prompted to name the payload-free package. By default, the name filled in will be Payload-Free Installer Package.

Screen Shot 2014-03-07 at 5.25.04 PM

This name can be changed as desired.

Screen Shot 2014-03-07 at 5.21.36 PM

5. Once you’ve entered a name for the installer package, you’ll be prompted for a package identifier. By default, the name filled in will be com.github.payload_free

Screen Shot 2014-03-07 at 5.21.48 PM

This name should be changed to be something unique.

Screen Shot 2014-03-07 at 5.22.04 PM

6. Once the package name and package identifier have been set, Payload-Free Package will prompt for an administrator’s username and password.

Screen Shot 2014-03-07 at 5.22.17 PM

7. Once the admin username and password are provided, Payload-Free Package will create the payload-free package and prompt you when it’s finished.

Screen Shot 2014-03-07 at 5.22.25 PM

8. Click OK at the prompt and a new Finder window will open to display the newly-created payload-free package.

Screen Shot 2014-03-07 at 5.24.04 PM

Screen Shot 2014-03-07 at 5.24.16 PM

9. Payload-Free Package will automatically exit once finished.

How Payload-Free Package works

Payload-Free Package is an Automator application that uses AppleScript, shell scripting and pkgbuild behind the scenes to create payload-free packages. When a script is selected, the following process takes place:

1. The script is copied to /tmp and the file is renamed to postinstall, to match the name that pkgbuild is expecting for a post-installation script.

2. After the package name and package identifier are chosen, /tmp is checked to make sure that there is not an existing directory that is named the same as the chosen name. If a matching directory is found, it is removed.

3. A new directory is created in /tmp that matches the chosen name of the package.

4. Next, a scripts directory is created inside of /tmp/package_name_here.

5. The postinstall script is moved to /tmp/package_name_here/scripts.

6. The payload-free package is built by pkgbuild using the postinstall script stored in /tmp/package_name_here/scripts.

7. The finished payload-free package is stored in /tmp/package_name_here and the user is prompted that the process is finished.

8. Once the user is notified and clicks OK, a new Finder window opens for /tmp/package_name_here.

The total workflow looks like this:

Screen Shot 2014-03-07 at 4.32.02 PM

The AppleScript used to create the payload-free package as part of the Automator work is below:

All Payload-Free Package Creator components and scripts are available at my GitHub repo:

The Automator workflow files and the AppleScript are also available via the link above if you want to build a customized Payload-Free Package Creator for your own environment.

  1. March 8, 2014 at 8:21 pm

    Wow, this looks to be exceptionally handy. Thanks!

  2. Ben Goodstein
    March 10, 2014 at 2:08 pm

    Seconded. Good work!

  3. March 18, 2014 at 7:50 pm

    This is great could you add a section for version number?

  4. March 16, 2015 at 8:54 pm

    when I attempt to import a .pkg built with this tool using munkiimport ( I get the following error:

    WARNING: No valid Distribution or PackageInfo found.
    somePayloadFree.pkg doesn’t appear to be a valid installer item!
    Getting package info failed.


    • cashxx
      April 16, 2015 at 7:18 pm

      Was just coming in to say the same thing! Haven’t found a fix yet.

  5. April 16, 2015 at 7:44 pm

    Payload-free packages generated with this tool should not be used with Munki. This is because it uses pkgbuild’s method of generating payload-free packages, which does not leave a recipt behind.

  6. sahil rai
    April 8, 2016 at 3:30 am

    but how to install it in kali linux…?

  7. Scott
    April 12, 2020 at 11:17 pm

    Now that PPPC is here, how do we set it to allow writing to 10.15.4 space that is readonly?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: