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


Click here to return to the 'Remote mounting of disk images without logged in local user' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remote mounting of disk images without logged in local user
Authored by: randycarpenter on May 08, '03 11:11:09PM
We remotely install stuff like this all the time but haven't figured out how to hide it from the user yet. Here's a sample script that installs Java 1.4.1:
#!/bin/sh
#
# 5/7/03 - Install Java 1.4.1
#
COLLDIR="insert directory here that contains java 1.4.1 dmg 
file)"

# Change the current user to root (UID=0)
disktool -c 0 || exit 1

hdiutil mount $COLLDIR/Java1.4.1.dmg || exit 1
installer -pkg '/Volumes/Java 1.4.1 Update/Java1.4.1.pkg' -
target / || exit 1
DEV=`/sbin/mount | grep '/Volumes/Java 1.4.1 Update' | cut -
d" " -f1` || exit 1
hdiutil detach $DEV || exit 1

# hmm...installer seems to chmod g+w / which breaks 
sendmail.
chmod g-w / || exit 1

exit 0
The macosxhints editor is causing truncation of the commands in the script so you will need to do some editing (grrr).

You can also use this technique with typical "drag and drop" installs using the "ditto -rsrsFork" command. The frustrating this is that some vendors release binary installers (i.e. no convenient .pkg or .dmg files) so you have to install them and then figure out what files it installed, then create a .dmg after the fact. Is there a better way?

One other gotcha is that some installers (e.g. QuickTime 6.2) insist on popping up windows in Aqua for you to click which frustrates us remote installers. I suppose that an AppleScript would solve the problem but I haven't be ventured into that territory yet.

[ Reply to This | # ]