A fix for an iTunes 6.0.1 command line install bug

Dec 16, '05 06:26:00AM

Contributed by: Johnny_B

If you update to/install iTunes 6.0.1 using the softwareupdate CLI program from cron or any other Terminal app that you don't use in the foreground (launchd, my own updateserver, etc.), then it will hang at the preinstall script. For more info check this macosxhints forums thread.

I still don't know why it happens, but I've found a solution to this problem. Change the following line in the preinstall script inside the iTunes.pkg packages. Note that it's shown on two lines here, but it's one long line in the file:

/usr/bin/su $USER -c ""$PACKAGE_PATH/Contents/Resources/InstallHelper" 
 /Applications/iTunes.app/Contents/Resources/iTunesHelper.app" 2> /dev/null
Change it to read:
/usr/bin/sudo -u $USER ""$PACKAGE_PATH/Contents/Resources/InstallHelper" 
 /Applications/iTunes.app/Contents/Resources/iTunesHelper.app" 2> /dev/null
So it looks like the script doesn't like su, but instead prefers sudo. I've reproduced this error many times, also with my own test scripts, and this fixes it every time. Any comments on why?

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051213080429704