Home > AutoPkg, Mac administration, Mac OS X, Packaging > Using AutoPkg to build installer packages from installer applications

Using AutoPkg to build installer packages from installer applications

One of the challenges Mac admins have to deal with are Mac application installers which don’t follow one of the following models:

In many cases, these alternate installers take the form of applications which may or may not have options for installing via command line. For those that do not have the option of command line installation, the only real option is to install the application in question, then re-package it as either a drag-and-drop install or an installer package.

However, for those installer applications that do support command line installation, this opens up the option of embedding the installer application inside an installer package and using a postinstall script to run the necessary commands for the installer application to install its files onto the Mac. I’ve used this workflow several times in the past, with some examples linked below:

These examples have been manually built by me on an as-needed basis as new versions are released, but wherever possible, I want to automate this process using AutoPkg. Thanks to being able to study a recently-built .pkg recipe for AccuBarcodePro created by @foigus, I was able to build recipes for AutoPkg which handle downloading and packaging the following installer applications:

For more details, see below the jump.

In the case of both the Sophos and Adobe installer workflows, the AutoPkg recipe model looks like this:

  1. Download the installer application from the vendor.
  2. As part of an AutoPkg .pkg recipe, create a Scripts directory that AutoPkg will later include as part of building an installer package
  3. Copy the installer application into the Scripts directory
  4. Add a postinstall script to run the needed commands for the installer application to the Scripts directory
  5. Build an installer package which has the installer application and postinstall script embedded inside the package.

For the Creative Cloud Installer package recipe, copying the installer application involves using the Copier processor to copy the application from the downloaded Creative Cloud disk image and into place inside the Scripts directory.

Once the installer application is stored in the Scripts directory, the FileCreator processor is leveraged to create the needed postinstall script and likewise store it in the Scripts directory.

Once both the installer application and script are stored in the Scripts directory, the PkgCreator processor is called to create an installer package which includes setting the Scripts directory as the location from which the package calls preinstall and postinstall scripts.

The Sophos package recipe involves a similar method, with the exception of how the installer application gets into the Scripts directory. The Sophos download is a .zip file, so the Unarchiver processor is leveraged to extract the contents of the zip file directly into the Scripts directory. The Sophos download includes both an installer application and a separate associated directory containing the installation files, so being able to extract directly into the Scripts directory means that both the installer application and associated directory are placed into the Scripts directory in one step.

Screen shot 2015 02 25 at 7 48 51 pm

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment