Building an Installer — Part 5
An installer that builds 3 installers and then builds another installer to install the three installers.
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.
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.
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:
- Created a basic package that shows how to install the contents of a specific folder
- Written a script that runs the creation of a single package
- Created three separate folders whose content we want to install
- Created three separate installers for each folder
- Written a script that builds all three installers at the same time
- Created an package that runs all three installers at the same time
- Written a script that builds a single package that runs all three installers at the same time
- 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.