Quantcast
Channel: rtrouton – Der Flounder
Viewing all articles
Browse latest Browse all 764

Simple Package Creator.app

$
0
0

One task that has always seemed to me to take more time than it should is the process of packaging applications like Firefox, Google Chrome or other applications which are self-contained and can be copied as-is into /Applications. While tools like AutoPkg have helped a good deal by automating the download and packaging of various self-contained applications, this approach still requires some setup work and requires a recipe to be written to handle the application.

Screen Shot 2014-04-28 at 3.06.33 PM

To help make this task easier, I’ve developed Simple Package Creator.app, an Automator application that will allow the selection of a self-contained application and creates an installer package that enables the installation of the application with pre-set permissions into /Applications. For more details, see below the jump.

Using Simple Package Creator.app

1. If needed, download the Simple_Package_Creator_Installer zip file from the installer directory in my GitHub repo.

2. Once downloaded and installed, double-click on the Simple Package Creator application in /Applications.

Screen Shot 2014-04-28 at 5.01.30 PM

3. You’ll be prompted to select the self-contained application that you want to create an installer package from.

Screen Shot 2014-04-28 at 5.00.02 PM

4. Once you’ve selected the self-contained application, the application will be copied to a temporary build location and a dialog window will appear to let you know that this may take a little while.

Screen Shot 2014-04-28 at 4.52.09 PM

5. Once the application has been copied, you’ll be prompted to name the installer package.

Screen Shot 2014-04-28 at 4.52.29 PM

By default, the name filled in will be My Great Application Installer Package, but this name can be changed as desired.

Screen Shot 2014-04-28 at 4.52.36 PM

6. Once you’ve entered a name for the installer package, you’ll be prompted for a package identifier.

Screen Shot 2014-04-28 at 4.52.42 PM

By default, the name filled in will be com.github.simple_package, but this name should be changed to be something unique.

Screen Shot 2014-04-28 at 4.52.52 PM

7. Once you’ve entered a name for the installer package, you’ll be prompted for a version number.

Screen Shot 2014-04-28 at 4.53.10 PM

By default, the value filled in will be 1.0, but this value should be changed to be something unique (preferably related to the application’s version number.)

Screen Shot 2014-04-28 at 4.53.16 PM

8. Once the package name, package identifier and package version have been set, Simple Package Creator.app will prompt for an administrator’s username and password.

Screen Shot 2014-04-28 at 4.53.23 PM

9. Once the admin username and password are provided, Simple Package Creator.app will create the installer package and prompt you when it’s finished.

Screen Shot 2014-04-28 at 4.53.41 PM

10. Click OK at the prompt and a new Finder window will open and display the newly-created installer package.

Screen Shot 2014-04-28 at 4.53.57 PM

11. Simple Package Creator.app will automatically exit.

Once installed, the self-contained application will be stored in /Applications and will have the following permissions:

Owner: root (read-write)

Group: wheel (read-only)

Everyone: (read-only)

Screen Shot 2014-04-28 at 5.03.43 PM

Screen Shot 2014-04-28 at 5.03.51 PM

How Simple Package Creator.app works

Simple Package Creator.app is an Automator application that uses AppleScript, shell scripting and pkgbuild behind the scenes to create installer packages. When a script is selected, the following process takes place:

1. The self-contained application is copied to /tmp as a zip archive named simple_package_creator_tempfile.zip, to give the package-building script a consistent value to work with.

2. After the package name, package identifier and package version are set, /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 Payload directory is created inside of /tmp/package_name_here

5. The application zip archive’s contents are extracted to /tmp/package_name_here/Payload.

6. The installer package is built by pkgbuild using the application now stored in /tmp/package_name_here/Payload

7. The simple_package_creator_tempfile.zip file is removed from /tmp

8. The finished installer package is stored in /tmp/package_name_here and the user is prompted that the process is finished.

9. 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-04-28 at 4.39.59 PM

All Simple Package Creator components and scripts are available at my GitHub repo:

https://github.com/rtrouton/Simple-Package-Creator



Viewing all articles
Browse latest Browse all 764

Trending Articles