Final Cut Studio 3 Installer for Deploy Studio

From AFP548 Wiki
Jump to: navigation, search

Final Cut Studio V3 Installer "Tweaking" for Use with Deploy Studio And Similar Programs.[edit]

Overview:[edit]

This describes an approach that we used to modifying the Final Cut Studio 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. And since the Final Cut Studio Installer is 45-50G in size, it is a good stress test for many imaging approaches.

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.

If someone wanted to, these instructions could probably be automated in a script themselves. However, that is an exercise left for someone else.

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

Disclaimer: 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 Final Cut Studio v3 ships as seven DVDs with a bunch, about 50GB worth, of .pkg and .mpkg installers hidden in invisible folders on various DVDs. We are going to try to convert this into a single .mpkg bundle with everything inside of it. And we are going to try and "tweak" it so it will be installed by Deploy Studio. We tried something different that didn't work. So of the plan B choices, this had the best combination of looking like it might work and minimal effort.

Preparatory:[edit]

Make sure that you have a drive with a reasonably large amount of space available. You should allocate about 50GB for each working copy of Final Cut Studio. So, if you first convert the DVDs to .dmg files and then copy those to a folder to work on them, that alone will take about 100GB.

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: 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)

By default, our editors may not recognize .dist files as text files. So add the ".dist" suffix to the Languages submenu of Preferences. (Map to: (none) and "Neither")

Make Disk Images from Final Cut Studio DVDs:[edit]

Using Disk Utility, make copies of your Final Cut Studio 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 "Final Cut Studio 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 Final Cut Studio, you may just stop here. You can put the disk images on their own external hard drive, of file server, and open the disk images. Once they are all 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 you don't have to baby-sit it for each DVD.

Copy Mounted Disk Images to Folder:[edit]

Make sure all the disk images are mounted. (We had 7.) Copy all of them to a folder. When you get done, this folder should contain a subfolder with the same name and the contents of each of the disk images.

Postpone License Check:[edit]

During the development of this, I did many test installs. Since I was not working with a Site License/Volume License version, needing to enter the license key each time was a bit of a hassle. The following procedure will remove the requirement to enter a license key from the install. However, when you launch any of the programs, a dialog will pop up asking you to enter the license key. So this isn't a door to piracy. But it does make testing a bit more handy.

:Note: If you are happy with doing installs from the FCS disk images, but would like to add just this feature, you may do so. You will need to convert the Final Cut Studio Installer disk image into a read/write format, which Disk Utility will be happy to do for you. Once converted, you make the appropriate edits and convert it back.

Open the "InstallerSections.plist" file at <…./Final\ Cut\ Studio\ Install/Installer/FinalCutStudio.mpkg/Contents/Plugins/InstallerSections.plist> and remove the following line:

		<string>AELicensingPlugin.bundle</string>

This line is responsible for making you enter the license during the install. Removing it won't relieve you of the license requirement, you will still have to enter a license before you can run Final Cut. It won't affect the command line install, but it makes it a pain for testing. So, I took it out. If you are using the volume/site license version, things may look different here, and this editing is probably not necessary.

There are two other lines that you may take out or leave in at your discretion:

		<string>CompressorSharedService.bundle</string>

This line is responsible for the dialog that asks you if you want to make your computer available for distributed processing with Compressor and Apple Qmaster. It can set the value of <~/Library/Preferences/com.apple.recentitems.plist> for the current user. Since Deploy Studio will be doing a command line install, it will not be run. And even it it were, it will not be logged in as a regular user, so it is not relevant to us. You can leave it or remove it at your discretion.

And:

		<string>FinalTouch.bundle</string>

This line cause the user interface dialog box titled "About Choosing Applications" to be displayed. It should have no effect on DS, since that will be a command line install. Again, You can leave it or remove it at your discretion.

Enable Full Command Line Install:[edit]

Open the Invisible/hidden folder named "Installer" which is inside of the "Final Cut Studio Install" In it you should see the real "FinalCutStudio.mpkg" file and a "Packages" folder. Open the FinalCutStudio.dist file.

Looking at the FinalCutStudio.dist file, there are a whole bunch of " start_selected="!system.env.COMMAND_LINE_INSTALL &&". So, running this from the command line is setup to not install a whole bunch of things. Note: Oddly, the Final Cut installer tests to see if it is being driven by a command line install. If it is, it will permit an install on other than to boot volume, but it turns off most of the packages. My guess would be that they use this same installer to add FC to as a build-to order option. Since the command line "installer" command allows you to specify a plist file with options, Apple probably has such a plist for their own use. Or Apple may script the installers to run individually.

But since DS doesn't currently have support for this .plist file to specify install choices, that wasn't a good option in our case. We also thought about doing it in sets of smaller packages. But getting all the package reference links right looked like more work than this approach. So we did what we did because we were lazy and it looked like the easiest solution. But a variation on what we did may work better for you.

Replace all occurrences of:

	!system.env.COMMAND_LINE_INSTALL &amp;&amp;

with:

NOTHING (not the word "NOTHING" but what the word means)
In our case, 9 occurrences were found and replaced.

Replace all occurrences of:

 	start_selected='!system.env.COMMAND_LINE_INSTALL'

with:

	 start_selected='YES'
In our case, 6 occurrences were found and replaced.

The good news is that this occurs only in the FinalCutStudio.dist file.

Reorganize FinalCutStudio Installer(s)[edit]

Create a "Working" folder[edit]

Open the Invisible/hidden folder named "Installer" which is inside of the "Final Cut Studio Install" In it you should see the real "FinalCutStudio.mpkg" file and a "Packages" folder.

Move the FinalCutStudio.mpkg out of the invisible "Installer" folder and into the Working folder. Open the FinalCutStudio.mpkg (right click or control click to Show Package Contents). Now move the "Packages" folder from the hidden "Installer" folder into the inside of the "Contents" folder of the "FinalCutStudio.mpkg"

Read the above again. It is important that we get this right. The "Packages" folder should now be inside of the the "FinalCutStudio.mpkg" package "Contents".

Each of the remaining folders from the disk images, also will have a hidden folder named either "Installer" or "Packages". Move the contents of all of these folders (lots of .pkg or .mpkg files) into the "Packages folder inside of the Contents of the "FinalCutStudio.mpkg" Do this for each of: Audio Content 1, Audio Content 2, Audio Content 3, Motion Content 1, Motion Content 2, DVD Studio Pro Content

Do NOT copy any of the "Extras" in the Final Cut Studio Install folder and don't copy any documentation. We will deal with these later.

Double-check to see if you missed any. Our "FinalCutStudio.mpkg/Contents/Packages" folder now has 64 .pkg & .mpkg packages in it. (Not counting any hidden .ds, .fsevntd, or other such housekeeping items.)

It would be nice if we were done, but we aren't inside each of the .mpkg may be more packages. Those packages are:

AudioContentforSoundtrackPro.mpkg ---contains 3
Calligraphy.mpkg ---contains 0
DVDStudioProContent.mpkg ---contains 4
MotionContent.mpkg ---contains 0

Note: The finder has the ability to label things under File>Label:. If you find it helpful, you may label these .mpkg packages.

Open each of them and look. If there is a folder named Packages which has .pkg (or even .mpkg) files, move them (the individual packages, not the folder) to the common Packages folder that we moved things to above. In our case, there were only

Double-check to see if you missed any. Our "FinalCutStudio.mpkg/Contents/Packages" folder now has 71 .pkg & .mpkg packages in it. (Not counting any hidden .ds, .fsevntd, or other such housekeeping items.)

Of course, moving all of this stuff around, has broken all kinds of internal references that we will have to fix. One of the reasons that we moved everything into the same place is to make it easier to do global changes to fix everything.

Edit the "FinalCutStudio.dist" file:[edit]

Since moving everything around, we now have a whole bunch of package references in the Installer .dist files that now point to the wrong place. Following are two such sample lines from the FinalCutStudio.dist file:

<pkg-ref id='com.apple.pkg.SurroundImpulseResponses' auth='Root' installKBytes="876836" version="1.0.0.20000.1609">'''file:../Packages/'''SurroundImpulseResponses.pkg</pkg-ref>
<pkg-ref id='com.apple.pkg.SoundtrackProSurroundSpaceDesignerPreSets' auth='Root' installKBytes="288" version="1.0.0.20000.1609">'''file:../Packages/'''SoundtrackProSurroundSpaceDesignerPreSets.pkg</pkg-ref>
<pkg-ref id='com.apple.pkg.AudioContentforSoundtrackPro1A' auth='Root' installKBytes="2929051" version="1.1.0.260000.97">'''x-disc://Audio%20Content%201/Installer/'''AudioContentforSoundtrackPro.mpkg/Contents/Packages/AudioContentforSoundtrackPro1A.pkg</pkg-ref>
<pkg-ref id='com.apple.pkg.AudioContentforSoundtrackPro1B' auth='Root' installKBytes="2849051" version="1.1.0.260000.97">''x-disc://Audio%20Content%201/Installer/''AudioContentforSoundtrackPro.mpkg/Contents/Packages/AudioContentforSoundtrackPro1B.pkg</pkg-ref>

Find the "FinalCutStudio.dist" file. It is inside of the Install "FinalCutStudio.mpkg" . The path is something like: ….Working/FinalCutStudio.mpkg/Contents/FinalCutStudio.dist

Open the "FinalCutStudio.dist" 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:
		(<pkg-ref id='.*>){1}(.*/){1}(.*\.pkg|.*\.mpkg){1}(</pkg-ref>){1}
with:
		\1file:./Contents/Packages/\3\4
We had 71 occurrences.

Following is an explanation of what we are trying to do. And since I'm not a grep 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 id='.*>){1} Look for the string "<pkg-ref id= 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.
file:./Contents/Packages/ The string "file:./Contents/Packages/" Instead of looking where ever the package used to be, since all the packages are now in the same folder, we should just have to look in the Packages folder, hence file:./Contents/Packages/
\3 The third pattern.
\4 The fourth pattern.

Save the changes.

'Update Remaining Internal References in .dist Files:[edit]

Since moving everything around, we now have a whole bunch of package references in the Installer .dist files that now point to the wrong place. Following are two such sample lines from the "AudioContentforSoundtrackPro.dst" file.

<pkg-ref id='com.apple.pkg.AudioContentforSoundtrackPro1C' auth='Root' installKBytes="2616500" version="1.1.0.260000.97">file:./Contents/Packages/AudioContentforSoundtrackPro1C.pkg</pkg-ref>
<pkg-ref id='com.apple.pkg.AudioContentforSoundtrackPro2A' auth='Root' installKBytes="2941592" version="1.1.0.260000.97">x-disc://Audio%20Content%202/Installer/AudioContentforSoundtrackPro2A.pkg</pkg-ref>

Having moved these other pkg files around, as we did, there is little chance that the installers will properly find them and install them. So we need to fix all of these and we need to do so without a typo. One of the reasons we moved all the packages, except the main one, into the same location was the hope that we could fix all of them at once. BBEdit and TextWrangler have built-in support our "friendly" grep command.

We are going to do a Multi-File replace. To do this will require a bit of setup. Find the "Multi-File Search…" command under the Search menu.

To select the group of files to do this multi-file replace on, find the Packages folder inside of the FinalCutStudio.mpkg (Working/FinalCutStudio.mpkg/Contents/Packages) and add it to the "Search in:" field to cause the editor to search in all files within it. To do this, you may just drag the Packages folder into the "Search in:" field to configure this.

We will also need to make sure we get all the right files within this folder. To do this, you will need to go into the Options button and enable "Search Nested Folders, and Search Invisible Folders". You will want to search for "Text Files Only." But for this to work, you may need to have first told your text editor that .dist is a text file, as suggested earlier. And you want to add a filter to make sure that only files ending in .dist are edited to prevent any surprises.

Following are a changes you should do to all .dist files within all of the Final Cut Studio installer stuff. Do a "Multi-File Search" and replace as indicated.

Within just the .dist files of entire Packages folder, do a grep enabled "Multi-File Search" and replace of all of the following:

with grep enabled, replace:
(<pkg-ref id='.*>){1}(.*/){1}(.*\.pkg|.*\.mpkg){1}(</pkg-ref>){1}
with:
\1../\3\4
We had 19 occurrences distributed over 3 files.

Following is an explanation of what we are trying to do. And since I'm not a grep 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 id='.*>){1} Look for the string "<pkg-ref id= 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.
../ The string "../" Instead of looking where ever the package used to be, since all the packages are now in the same folder, we should just have to look up one level relative to where we are, hence ../
\3 The third pattern.
\4 The fourth pattern.

Update Internal References in Info.plist Files: There are also some info.plist files in some of the .mpkg installers that we need to clean up. As before, we will do a "Multi-File Search…" and replace inside of the "Packages" folder. But instead of doing this on .dist files, we want to do it on Info.plist files. So add a filter to make sure that only files ending in Info.plist are edited to prevent any surprises.

The Info.plist files will have key value pairs something like:

<key>IFPkgFlagComponentDirectory</key>
<string>./Contents/Installers/</string>

I wasn't able to find good documentation, that I understood, concerning what these did. Apparently, they tell the installer where to look for packages. And while one older page said that failure to have them right would cause the Installer to fail with an "error 999", I didn't do anything with these on an earlier test and it didn't matter. But maybe with a different OS, etc. Or maybe, the paths in our references are optional and the fact that we have them means this doesn't matter. But, to avoid problems, I thought these should be right.

Within just the .dist files of entire Packages folder, do a grep enabled "Multi-File Search" and replace of all of the following:

with grep enabled, replace:
(<key>IFPkgFlagComponentDirectory</key>\s*<string>){1}(.*){1}(</string>){1}
with:
\1..\3
We had 4 occurrences, one each distributed over 4 files.

Following is an explanation of what we are trying to do. And since I'm not a grep 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 3 grep patterns in it. For each of these patterns, we allow a single repetition of. (Thats the {1} after them.)

(<key>IFPkgFlagComponentDirectory</key>\s*<string>){1} Look for the text "<key>IFPkgFlagComponentDirectory</key>"
with zero or more whitespace characters followed by the text "<string>". Whitespace characters include spaces, tabs, linefeeds and the like.
(.*){1} look for a string of zero or more characters.
(</string>){1} look for the text "(</string>)"

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

\1 The first pattern.
.. The string ".." Instead of looking where ever the package used to be, since all the packages are now in the same folder, we should just have to look to the folder, up one level relative to where we are, hence ..
\3 The third pattern.

Update Internal References in Info.plist File for FinalCutStudio.mpkg:[edit]

There should still be one last Info.plist file that we need to fix. This is the one in the same "Contents" folder with "FinalCutStudio.dist" and it is just outside of the "Packages" folder that we have been doing all our editing in. Find this file.

Since it is only one file, it is probably easier to just edit it, then to try and use grep or any replace options.. Open it with your text editor and:

Find the following:

<key>IFPkgFlagComponentDirectory</key>
<string>../Packages/</string>


replace it with:

<key>IFPkgFlagComponentDirectory</key>
<string>./Contents/Packages/</string>

Change Default Selection:[edit]

By default, the "Music Loops" part of Soundtrack Pro are not installed. We thought our users would like them.

Find the following:

<choice id="SoundtrackProMusicLoops" title="TITLE_SOUNDTRACKMUSICLOOPS" description='DESCRIPTION_SOUNDTRACKMUSICLOOPS' start_selected='false'>

replace it with:

<choice id="SoundtrackProMusicLoops" title="TITLE_SOUNDTRACKMUSICLOOPS" description='DESCRIPTION_SOUNDTRACKMUSICLOOPS' start_selected='YES'>

Or just carefully replace the 'false' with a 'YES' at the end of the line. Save the changes. Now, when you run the installer, the default should be to install these music loops.

Test:[edit]

It is a very good idea to do some careful testing before any mass deployment.

We noticed the following in our log files:

Nov 12 22:20:48 Apples-MacBook-Pro installd[178]: PackageKit: Executing script "./postflight" in /Volumes/Final Cut Work/Working/FinalCutStudio.mpkg/Contents/Packages/FinalCutPro.pkg/Contents/Resources
Nov 12 22:20:48 Apples-MacBook-Pro installd[178]: ./postflight: find: //Applications/Final Cut Pro.app.app: No such file or directory
Nov 12 22:20:48: --- last message repeated 1 time ---

This came from the file:

/Volumes/Final Cut Work/Working/FinalCutStudio.mpkg/Contents/Packages/FinalCutPro.pkg/Contents/Resources/postflight

which was originally at:

/Volumes/Final Cut Studio Install/Installer/Packages/FinalCutPro.pkg/Contents/Resources/postflight

It has the lines:

`find \"$target/Applications/Final Cut Pro.app.app\" -name info.nib -exec rm {} \\\;`;
`find \"$target/Applications/Final Cut Pro.app.app\" -name classes.nib -exec rm {} \\\;`;


The "app.app" is probably a "bug". The goal was likely to delete both info.nib and classes.nib from the install. But, I don't know what the implications of doing this are. And since it seems to work, and it was a preexisting Apple bug, I decided to ignore it.

Notes:[edit]

Final Cut Studio has some optional installs that are only installed if you have iDVD. So if you are going to install iDVD, it looks like you might want to install it first.