Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Extract files from OS X installers System
Bart Van den Broeck wrote in with the following tip for extracting individual files from the OS X installer package. Bart writes:

On MacFixit's Mac OS X late-breakers page a few days ago it was suggested you could "extract individual files" from Installer packages by decompressing the entire archive and than getting individual files from that. Since I don't have loads of hard drive space to spare, I figured out a better way. I hope some of you with limited HD space might benefit from it.

Read the rest of this article if you'd like to learn how to extract individual files...

Bart wrote the following letter to MacFixIt, and copied it to macosxhints. I've reformatted it a little to make it easier to read here...

From: Bart
Date: vri apr 20, 2001 10:39:38 Europe/Brussels
Subject: Extracting the Carbon SimpleText application from the Developer CD

Hi there

Jason Harris' tip about seeing what gets installed by Installer files when there's no ".bom" or ".bomout" file included (you can read the ".bom" file with the lsbom command line utility; this seems to result in output identical to the ".bomout" file) has put me on track. I have extracted only the SimpleText folder in the Carbon Examples of the Developer CD from the ".pax.gz" archive.

This is the command I used ("cd" to the folder you want to have the SimpleText folder be put into first):
gunzip -c '/Volumes/Developer Tools/Developer.pkg/Contents/
Resources/Developer.pax.gz' | pax -r -s[space]
This is a one line command (!!) [Editor's note: I have broken it into multiple lines for ease of reading here; replace [space] with an actual space character, and type it all as one line]. It first un-gzips the Developer.pax.gz archive to stdout (standard outpout; so no files are actually written, the result is "piped" (read "passed on", the "|" does the piping) to the utility 'pax'. Pax reads ("-r") the file/folder with path matching the pattern "./Developer/Examples/Carbon/SimpleText" and writes it (and its contents, in the case of a folder) out to the folder you're in.

The "-s" option replaces in the paths the string "./Developer/Examples/Carbon/" with the string "./", thereby effectively causing the extracted files to be written to the path "./SimpleText", i.e. a folder SimpleText is created in the current folder, instead of to the path "./Developer/Examples/Carbon/SimpleText", i.e. creating a SimpleText folder which is located in the Carbon folder which is located in the Examples folder which is located in the Developer folder which, finally, is located in the current folder. [Editor - whew, that's tricky to explain!]

After this unexpected success, I got greedy and also got some other useful tools from the CD with the command:
gunzip -c '/Volumes/Developer Tools/Developer.pkg
/Contents/Resources/Developer.pax.gz' |[space]
pax -r -s ',./Developer/Tools/,./,' './Developer/Tools/CpMac'[space]
'./Developer/Tools/GetFileInfo' './Developer/Tools/SetFile'
[Editor: Again, replace [space] with the actual space character] Same explanation as above, only now it extracts the CpMac, GetFileInfo and SetFile tools for copying like a Mac, not a Unix, from the command line, for getting file info, and for setting it respectively. The value of the "-s" option changed in order to accommodate the new paths.

Oh, yeah, since it's a large archive the commands may take a while to complete.

Bart Van den Broeck

[Editor's note: I have not used this extraction technique myself, but the explanation makes sense.]
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)

Extract files from OS X installers | 2 comments | Create New Account
Click here to return to the 'Extract files from OS X installers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Works great!
Authored by: JugheadsRevenge on May 21, '01 09:43:39PM

Worked just like it was supposed to. Just cleaned it up a bit in TextEdit before pasting in, and it was fast. Now no more Classic SimpleText for me!


[ Reply to This | # ]
Path in Jaguar is different
Authored by: klieb2002 on Nov 15, '03 12:25:48PM

Update: the path for the developer tools has changed on the Jaguar developer CD. An updated command example for grabbing the CpMac command is shown below:

gunzip -c '/Volumes/Developer Tools/Packages/DevTools.pkg/Contents/Archive.pax.gz' | pax -r -s ',./Developer/Tools/,./,' './Developer/Tools/CpMac'

[ Reply to This | # ]