Sometimes, bad things happen even when we're being careful. You know, like the time you accidentally threw out Mail.app and emptied the trash right away. Or you have a slight disk problem and somehow iChat has become corrupted. Maybe a program is acting oddly and you suspect a part of it is damaged. If any of this has happened to you, then one utility that might save you is Pacifist from CharlesSoft ($20 shareware). Pacifist will let you re-install a single program that came with your OS (10.3.9 and up for the current version, an older version is available for 10.2) like Mail that normally would require a re-install of the operating system. Of course, if you have that Time Machine or other backup, you should already be set…unless it's corrupt, or otherwise unusable, or the app that damages has files scattered all over and you don't know where they all are. You can also use it to install other package files.
Above is the start screen. You can open a PKG file or a ZIP, MPKG (metapackage), DMG, TAR, TAR.GZ, TAR.BZ2, CPIO, CPIO.GZ, CIPIO.BZ2, , and XAR files. That's pretty much every sort of compressed format you're likely to run into. You can even open them via URL, so you can use Pacifist to download a ZIP file, for example. You can then install the program from Pacifist.
For example, I opened the "ClickToFlash" zip file on my system (with the "Open PKG" button) and got the following listing of the contents:
You can see all the files, and where they will end up after installing. Pacifist can install the software, extract it to somewhere on your disk, and even verify already-installed software (it will check that that files are all in the right places and make sure they are the same versions as in the install). You can chose just to extract individual files if you like, and even view the files ("postflight" and "preflight" above are Unix scripts, so if you want to learn what they're doing, you can select them and click on "View Files" – checking out others' scripts is a great way to learn how to write your own).
I've used Pacifist for years, many times just to get a good look inside a package file. Sure you can do that by right-clicking and choosing "Show Package Contents," but you can't also verify an install or so easily, in one step, open up so many file types.
The third button, "Open Apple Install Discs," is only disabled because I didn't insert an OS X disc into a drive. You can look at all the files on the install disc and re-install a missing or damaged app. You may want to run the latest Combo update from Apple right afterwards if you do, though, to make sure you are up to date, as unless you are running the same release as on the disc, you will lose any updates that might be required to run. Of course, you might want to do this to get back an older version that worked.
This is a great piece of software. You may never need it, but it's good to know it's out there if you do, and well worth the $20. Registering entitles you to all upgrades. There's no time limit on the unregistered software, but you will get nag screens until you pony up (and if you want authors to keep writing useful things like Pacifist, and you use it, you really should).