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

A fix for an iTunes 6.0.1 command line install bug Apps
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?
    •    
  • Currently 3.60 / 5
  You rated: 5 / 5 (5 votes cast)
 
[7,974 views]  

A fix for an iTunes 6.0.1 command line install bug | 8 comments | Create New Account
Click here to return to the 'A fix for an iTunes 6.0.1 command line install bug' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A fix for an iTunes 6.0.1 command line install bug
Authored by: Johnny_B on Dec 16, '05 07:19:11AM
Liks like there is a bug in this posting system... It doesn't like the character \

""$PACKAGE_PATH/Contents/Resources/InstallHelper"

This line in both the orginal and the one to be replaced should be:
"\"$PACKAGE_PATH/Contents/Resources/InstallHelper\"
... the rest as shown in the hint.

[ Reply to This | # ]
A fix for an iTunes 6.0.1 command line install bug
Authored by: adams4 on Dec 16, '05 09:00:05AM

The reason that sudo works and su doesn't is that su isn't supposed to work that way.

su is the command to substitute user, which can be useful when you're running Terminal and need to "look like" another user when you execute commands in that shell. What's happening is that you've started a new shell within your current shell, and the shell will just twiddle its virtual thumbs waiting for input. Once you su, you need to exit that shell to get back to your own user (and shell).

sudo, on the other hand, means "execute a command as another user." If you're already authenticated in the current shell (e.g., you authenticated less than 5 minutes ago), then the command is run as if you were the user you've substituted; no new shell is generated or needed. When the command is done, you're still you. :)

---
Adam Spector.

[ Reply to This | # ]

A fix for an iTunes 6.0.1 command line install bug
Authored by: plambert on Dec 16, '05 11:52:08AM

Not exactly true.

The "su" command simply runs a shell or command as another user, if you have the target user's password. The "sudo" command does the same, but first consults a configuration file which by default only requires the originating user's password (and, on Mac OS X, only allows sudo access for users in the "admin" group).

The Installer.app GUI will run the installation as root, and so the "su" becomes the user in question, runs that command, and then continues on in the script.

If you are running "softwareupdate" not as root, the "su" will fail, because it's asking for root's password, not yours, and root doesn't have a valid password by default on Mac OS X.

Plus, it'll just turn around and run the following command as you again.

[ Reply to This | # ]

A fix for an iTunes 6.0.1 command line install bug
Authored by: Johnny_B on Dec 16, '05 06:13:39PM

The script is run as root. cron is runned as root. I actually use an easy perl socket server which runs as root and when it gets daily/weekly/monthly it will run these script. In the weekly script, I've included softwareupdate. The perl server is started with a StartupItem which is runned as root.



[ Reply to This | # ]
A fix for an iTunes 6.0.1 command line install bug
Authored by: nvdingo on Dec 16, '05 09:06:32AM

i haven't installed anything from the command line, but how does this fix help?

If you are installing automatically using whatever mechanism, to have your updates done while you aren't around, and this hang occurs, then the update didn't take place.

Why, oh why, would you go through the hassle of drilling into the install package which downloaded already, and editing that line, when by the time you came in and found the problem, you could just double click the installer package.

I concede that i am obviously missing something here. Please tell me what it is.
Please explain the circumstances under which you would go through the effort of editing the command via the CLI. Just because i can't see it being necessary in my normal routine, doesn't mean it isn't necessary in yours, and i am truly curious.



[ Reply to This | # ]
A fix for an iTunes 6.0.1 command line install bug
Authored by: iteratix on Dec 16, '05 11:03:09AM

Because when you're installing on 50 computers, it's not practical to go to each one of them and do the Double Click method.



[ Reply to This | # ]
A fix for an iTunes 6.0.1 command line install bug
Authored by: ced on Aug 29, '06 10:00:21AM

Try setting the USER variable in your script ahead of the softwareupdate, seems to work for us.

export USER=root



[ Reply to This | # ]
A fix for an iTunes 6.0.1 command line install bug
Authored by: Johnny_B on Aug 01, '08 07:00:13PM

This seems to only work if you can login as root to the system (root has a password). I used another user on my system (let's say foo) and that worked to... Thank you!



[ Reply to This | # ]