Building an Installer — Part 5

An installer that builds 3 installers and then builds another installer to install the three installers.

C4
The C4 Dev

--

Wow. That’s a dumb subtitle, but it’s exactly what we’re going to do.

Getting Automated

We’re starting to get into a nicely automated build script. We currently have two files: one that builds 3 installers, and one that builds an installer to install all three installers.

Ironically, putting these together is dead easy.

1. Create a new file called automatedBuild.sh

2. Add the following lines to the script:

sh buildMultipleInstallers.shsh buildMultiplePackage.sh

3. Delete the following: mulitplePackage.pkg, folder1.pkg, folder2.pkg, folder3.pkg, distribution.xml and finally the folders directory.

4. Run the automatedBuild.sh script.

Running the automated build script produces much more output

BOOM!

One script produces three packages, then creates a distribution file and builds a fourth package that, when run, installs the contents of the three packages onto the desktop. This is getting really powerful.

What We Have

Now, we have a set of three scripts and three folders with each folder containing a single image, and all of which are sitting on the desktop.

The files and folders we created can be grabbed from the link above the image

From Terminal, we navigate to the Desktop and run the automatedBuild.sh script to produce an installer.

Running the installer produces a new folder on the desktop that contains the contents of the three original folders we were working with.

C’est Tout

Through the first five parts of this walkthrough (incl. the one you’re reading right now), we’ve essentially gone through all the basics of creating an installer that does some fairly advanced tricks to automate the install of multiple things. In short, we’ve done the following:

  1. Created a basic package that shows how to install the contents of a specific folder
  2. Written a script that runs the creation of a single package
  3. Created three separate folders whose content we want to install
  4. Created three separate installers for each folder
  5. Written a script that builds all three installers at the same time
  6. Created an package that runs all three installers at the same time
  7. Written a script that builds a single package that runs all three installers at the same time
  8. Written a script that builds all packges and then creates the final installer

The next thing we’ll do is have a look at how the C4 Installer is actually built.

--

--

C4
The C4 Dev

Code, Creatively. An open-source API for iOS.