The experience of installing software on OS X is either dead simple or overly complicated.
Most apps are distributed as DMGs, although some are sent as .app files which have been .zipped.
If the app is just .zip’d then it is a simple matter:
1) Unzip file
2) Move file to /Applications
3) Trash .zip (You no longer have to worry about this in 10.5 if you have read my favorite Leopard hint so far)
Many other times you get a .dmg which mounts and then you drag the .app file to the /Applications/ folder. Hopefully the developer was nice enough to give you a link right in the DMG.
However, there are other DMGs lead to .pkg or .mpkg files, which are really installers.
Most OS X installers aren’t as evil as Windows installers, and most are really necessary, but it’s very annoying, to me, that I have to go through, click on the EULA, click on my hard drive icon (which I can’t do with the keyboard… doubly stupid since it is the only drive available, but you have to select it), and then click through.
Click click click mouse click click click mouse click click click mouse click click click mouse click.
Drives me nuts.
It is made worse by the fact that my shiny new iMac sits behind a slower satellite connection with a 30-day rolling bandwidth limit (about 280 MB/day I think). When there are a bunch of new updates from Apple (say, like, today) I will download them each individually rather than use Apple’s Software Updates. This lets me download the files only once (I can often do it at the office which has a very fast unmetered DSL connection) and use them on the MacBook and iMac.
However, Software Updates makes the whole “mount - select - click click click click” much less painful. I hated to give that up.
Well I stumbled onto an answer: /usr/sbin/installer
It’s a command-line version of the program used to install PKG and MPKG files (they aren’t really “files” I know).
Here’s what I did:
I wrote a script which looks for .pkg or .mpkg files which have been mounted off a DMG.
Then it installs them.
Then it ejects the DMGs.
You can download it here: install-pkg.sh.bz2
The script is highly commented, so everything it does ought to be clear.
Note that it uses a temp file (placed in your ~/.Trash) and sudo. Neither of these things bothers me, but they may bother other people.
No promises, if it breaks your hard drive, etc well it’s your fault, but it worked for me in limited testing.
If you have comments or questions, feel free to email me at tim#tntluoma#com (I trust you can figure out the email address from that)
Unanswered Question
1) If I take a dmg which could have been downloaded by Software Updates and put it in the proper folder, will Software Updates offer to install it for me?
2) If so, what is the proper folder?