ILife '11 Installer for Deploy Studio

From AFP548 Wiki
Jump to: navigation, search

Overview:[edit]

This describes an approach that we used to modifying the iLife '11 Installer so that it can be used as a package install from Deploy Studio. Other deployment tools that work similarly to Deploy Studio may also work better with this format than the original. It may even work as a package added to a NetInstall, by System Image Utility. However, while it should work in principal, I have not tested it.

This does not use PackageMaker or a similar to to "repackage". Instead, we move and edit the Apple supplied files directly using a text editor. (BBEdit or TextWrangler are used as examples.)

Corrections and clarifications to this document are welcome as long as they are consistent with the original approach. This is certainly NOT the only solution to the problem. But, if you would like to present a totally different approach, please do so as a separate document and leave this one intact.

This really looks like the kind of thing that, if someone wanted to, these instructions could probably be automated in a script themselves. However, that is an exercise left for someone else. But if you have the skill, your efforts would be greatly appreciated.

Please look over all instructions before starting. Failure to do so may result in remorse.

Disclaimer:[edit]

These notes are in draft form and describe what we did. You are free to use these notes only with the understanding that you assume all responsibility for any and all results.

Where This Is Going:[edit]

iLife '11 ships as a single DVDs with a bunch, about 25, of .pkg installers in a "Packages" folder hidden in invisible "Installer" folder on these DVD. Everything is at the same level, which makes it a bit tricky for use with Deploy Studio. We are going to move the main .pkg file up a couple of levels in the folder heirachy, which should address the Deploy Studio issue. We tried something similar to this with the much larger Final Cut Studio V3 program and got it to work. So we are hopeful that the same approach will work here..

Preparatory:[edit]

Make sure that you have a drive with enough space available. You should allocate about 4GB for each working copy of iLife '11. So, if you first convert the DVDs to .dmg files and then copy those to a folder to work on them, then make a final copy, that alone will take about 10-12 GB or so.

We did this as root to make sure that we didn't have permissions problems. But we don't really know if this was necessary or just superstitious.

Get a good text editor. I like BBEdit, but TextWranger will also work. (And so will a number of others. Just make sure it is a true text editor and not a word processor or things may go very bad for you.)

Dealing with Hidden/Invisible Folders[edit]

Since we will be working with the Invisible/hidden folders, you you might find it easier to change the defaults in Finder so such items are shown: From the command line, an appropriate defaults write will change the preference. Any of the following three samples should work to change the preference so that hidden/invisible files and folders are shown (you only need one of the three):

defaults write com.apple.finder AppleShowAllFiles -boolean true
defaults write com.apple.finder AppleShowAllFiles yes
defaults write com.apple.finder AppleShowAllFiles 1

To change the preference back, you can do the following:

defaults delete com.apple.finder AppleShowAllFiles
defaults write com.apple.finder AppleShowAllFiles -boolean false
defaults write com.apple.finder AppleShowAllFiles no
defaults write com.apple.finder AppleShowAllFiles 0

However, to get the Finder to notice the changed preference, you either need to logout and login again. Or you need to restart the Finder, which you can do with the following command line command:

killall Finder

Another option is to use one of the many utilities that will do this. There are many multi-function utilities that will do this. But following are a some limited purpose utilities that do this function:

Hidden Way
iShow Invisible
Show Hidden Files
Hidden Files
Show Hide Invisible files
Change Finder
InVisibles


Also, if you don't know, you can open .pkg and .mpkg bundles by either right clicking on them or by command clicking on them and selecting "Show Package Contents".

Configure Your Text Editor:[edit]

We assume that you are using BBEdit or TextWrangler which support Multi-File search and replaces. If you are using something else, adapting these instructions is an "exercise left to the student" (i.e. you)

Make Disk Images from iLife '11 DVD:[edit]

Using Disk Utility, make a disk image copy of your iLife '11 Install Disks. Use the File->New->Disk Image from folder… option and select the entire disk as if it were a folder. (This keeps you from imaging any blank space.) Make them in a read only image format such as "Read-Only," to prevent accidentally making changes to your electronic masters. A compressed format are also read-only, and you may use "Compressed" or even "Compressed (bzip2)", if you have it, to save some drive space. But this will come at a penalty of time to make the images and to open them. Put the disk images into a folder named something useful, such as "iLife '11 Install Disks".

Note: Doing a "Scan Image for Restore" operation from within Disk Utility sometimes seems to speed how quickly compressed disk images open. But it isn't necessary and "your mileage may very".

If you don't install a lot of copies of iLife '11, you may just stop here. You can put the disk image on their own external hard drive, of file server, and open the disk images. Once it is open, you can start the install and it will proceed normally, but without asking you for the next dvd and depending on the speed of your external drive or network file server, it may be MUCH faster than via DVD. And if you are so inclined, you might even script the mounting and installing from these disk images. But don't put too much work into that approach, lest doing it via Deploy Studio will be more prudent.

Modifying The Installer[edit]

Make a Read/Write Copy of your iLife '11 Disk Image:[edit]

Using Disk Utility, make a Read/Write copy, by using the convert function of Disk Utility. Select the disk image in the lower left pane of Disk Utility, then select the Convert Icon/tab just under the Disk Utility title bar. Give it the a different name so that you can tell which is which. We named ours RW iLife '11 Install DVD. Select the "read/write" Image Format and save it some where convenient.

Eject All DVDs, Disk Images, Etc.:[edit]

To avoid confusion, eject all DVDs, Disk Images, or similar.

Mount Read/Write iLife Image:[edit]

Mount the Read/Write iLife image that you just created. Find the mounted volume on the desktop and change its name from "iLife '11 Install DVD" to "DS iLife '11 Install DVD". This is to help tell them apart, both now and when you get done.

Go Into The Packages Folder:[edit]

If you have followed my naming choices, then the following should take you into the invisible Installer folder and into the Packages folder it contents. If you have not followed my choices, then adapt the commands appropriately.

cd /Volumes/DS\ iLife\ \'11\ Install\ DVD/Installer/Packages
open  .

Expand iLife Package:[edit]

The iLife '11 packages are in flattened format. Before we can work with them, we need to expand them. The command to do this is the pkgutil command with the --expand option.

pkgutil --expand    iLife.pkg    iLifeEXPANDED.pkg

Edit the iLife.pkg Distribution file:[edit]

Since we are going to be moving the iLifeEXPANDED.pkg, after we make some changes and flatten it, we will have a whole bunch of package references in the iLife Distribution file that will point to the wrong place. Following are some such sample lines from the Distribution file:

<pkg-ref auth="root" id='com.apple.pkg.AppleIntermediateCodec'>file:./AppleIntermediateCodec.pkg</pkg-ref>
<pkg-ref auth="root" id='com.apple.pkg.RAWCameraUpdate3'>file:./RAWCameraUpdate3.pkg</pkg-ref>
<pkg-ref auth="root" id='com.apple.pkg.iLifeCookie'>file:./iLifeCookie.pkg</pkg-ref>

Find the "Distribution" file. It is inside of the Install "iLife.pkg". Open the "Distribution" file with BBEdit or TextWrangler.

It is strongly suggested that you do just a find first, and look at the results. Then if things look right, replace all:

Within just this file, do a search and replace of all of the following:

with grep enabled, replace all occurrences of:

		(<pkg-ref auth=".*>){1}(.*/){1}(.*\.pkg|.*\.mpkg){1}(</pkg-ref>){1}

with:

		\1file:./Installer/Packages/\3\4

We had 24 occurrences.

SAVE THE CHANGES! and quit BBEdit/Text Wrangler.

Following is an explanation of what we are trying to do in the above replace using Text Wrangler or BB Edit. Since I'm not a grep/regular expression expert, I won't feel insulted if someone points out a better way to do it. We look for a string of text that has the following 4 grep patterns in it. For each of these patterns, we allow a single repetition of. (Thats the {1} after them.)

(<pkg-ref auth=".*>){1} Look for the string <pkg-ref auth=" followed by multiple characters, followed by ">"

(.*/){1} look for a string of characters followed by "/"

(.*\.pkg|.*\.mpkg){1} Look for a string of characters ending in ".pkg" or ".mpkg".

(</pkg-ref>){1} Look for the exact string "</pkg-ref>"

For each string of text that has the above 4 patterns in it, we replace it with a string made up of:

\1 The first pattern. \1file:./Installer/Packages/ The string "file:./Installer/Packages/" Instead of looking in the old relative path for the packages, it now looks in the new relative path \3 The third pattern. \4 The fourth pattern.

Save the changes.

Flatten & Move iLife Package:[edit]

In many cases one can work with packages that have been expanded. But the iLife.pkg wouldn't work for me in expanded form, so we're going to flatten it with our good friend "pkgutil" and the "--Flatten" option. And we are going to move it to a new home, at the same time.

The command to do this is:

pkgutil --flatten  iLifeEXPANDED.pkg   ../../iLife.pkg

Or, optionally the following:

pkgutil --flatten   iLifeEXPANDED.pkg     /Volumes/DS\ iLife\ \'11\ Install\ DVD/iLife.pkg

Clean Up to Make it Pretty (OPTIONAL):[edit]

If you would like to look a certain way on the disk image, before we make it read-only, now is the time to do that. Though it seems that some of what you do doesn't stick the next time you mount the disk image.

Remove Old Files (OPTIONAL):[edit]

At the moment, Deploy Studio doesn't follow Aliases or shortcuts, so these files wouldn't be executed by Deploy Studio. However, that could change, and in the interest of neatness, we are going to suggest some files that you can remove, if you want to. If you used a different naming convention, make sure you get the right one.

You may ether do the following from terminal, or find and remove them via the GUI.

rm         /Volumes/DS\ iLife\ \'11\ Install\ DVD/Install\ iLife
rm  -R   /Volumes/DS\ iLife\ \'11\ Install\ DVD/Installer/Packages/iLifeEXPANDED.pkg
rm         /Volumes/DS\ iLife\ \'11\ Install\ DVD/Installer/Packages/iLife.pkg

Make the "Installer" Folder Visible (OPTIONAL):[edit]

The desirability of doing this depends very much on your environment. Leaving the Installer folder invisible might keep people who don't know what they are doing from "mucking" with it. On the other hand, you might find it handy for it to be visible. To do this requires either that you have the Developer Tools installed, or that you have one of the multifunction utility packages that include this function. Following is the command to do it via the developer tools:

/Developer/Tools/SetFile -a v     /Volumes/DS\ iLife\ \'11\ Install\ DVD/Installer

Note: Using a lower case "v" will make it invisible and an upper case "V" will make in Invisible.

You might be wondering why we didn't do this step earlier. Well you can. And you will remember that we told you to read all the instructions first. So, if this caused you some grief, you should have followed the instructions. On the other hand, you got lots of good practice working with an invisible folder, so that's useful too.

Add Deploy Studio ReadMe Folder (OPTIONAL):[edit]

Wether or not you make the Installer folder invisible, you still have to make sure that they stay together. To at least warn people, it might be a good idea to put a text file at the root of the disk image to warn people. In a few months, you may have forgotten the details and the warning may help you.

Make a Read-Only Copy of your iLife '11 Disk Image:[edit]

Eject the "DS iLife '11 Install DVD" virtual disk from the desktop.

Using Disk Utility, make a Read-Only copy, by using the convert function of Disk Utility. Select the "RW iLife '11 Install DVD.dmg" disk image in the lower left pane of Disk Utility, then select the Convert Icon/tab just under the Disk Utility title bar. Give it the a different name so that you can tell which is which. We named ours "DS iLife '11 Install DVD". Select the "read-only" (or "Compressed") Image Format and save it some where convenient.

Note: for this installer, the optional "compressed (bzip2)" format, if you have that option, seems to result in a larger, not a smaller disk image than does the standard compressed format.

Test:[edit]

It is a very good idea to do some careful testing before any mass deployment. We tested it both as a local install and then we tested it from Deploy Studio. We suggest you do testing as well.

Installing in Deploy Studio:[edit]

Move the final disk image file to the Deploy Studio server via a means of your choice. (i.e. filesharing, USB Thumb Drive, etc.) Open the disk image. Copy the entire mounted volume into the packages folder used by Deploy Studio. If you named things the same way I did, you should have a folder named "DS iLife '11 Install DVD" in the Deploy Studio packages folder.

The folder should show up as a Deploy Studio package. (refresh/quit/restart DS may be necessary) And you should be able to select it as a package task within a workflow. Our preliminary testing indicates that it does NOT require the "Postponed Installation (Packages will be installed on first boot)" option.

Clean Up:[edit]

If the testing went well, you may want to move the original disk image and the final read-only disk image somewhere for safe keeping. The read/write disk image may be disposed of, once you are happy with the final read-only. However, if you have plenty of storage space, you may keep it too.

Notes:[edit]

If you will also be installing Final Cut Studio V3, then one issue is that Final Cut Studio V3 has some optional installs that are only installed if you already have iDVD, which is part of iLife. One might be inclined to think that, if you are going to install iDVD, you might want to install it first. But Final Cut Studio V3 probably assumed the prior version of iLife/iDVD. So you probably should do some testing on this.


Alternate Solutions:[edit]

Besides the standard fall back variations of installing everything, finding all the pieces and making your own installer package, there are some other options that might be worth testing:

Stuffing Everything Into One Big Über Package:[edit]

This approach may be found at the following URL: http://derflounder.wordpress.com/2011/08/07/repackaging-ilife-11-for-deploystudio/ Instead of "fixing" the Apple Packages so that they will work with Deploy Studio, it essentially puts all of them into a new package and uses a command line "install" command from within the postflight script of the new package.

Using File Shares & Scripts:[edit]

While I don't know of anyone who has yet reported testing this, another solution which looks like it should work, would be to put the iLife installer on a file server share. Then using the script features of Deploy Studio, you might mount that share and run the installer. A variation of this and the above approach, might be to create a package that installs nothing the normal way, but runs a postflight script, that mounts the share point and then does a command line "install". An obvious enhancement to either of these might be enhanced by putting a file with a list of packages to be installed on the share, and having the script install all of them.

Best Long Term Solution:[edit]

The best overall solution would probably be if a future version of Deploy Studio were to implement the "Install a Package" task enhancements suggested at http://www.deploystudio.com/Forums/viewtopic.php?id=2423