I'm having the same problem trying to install XCode 4.2. My configuration is:
* MBP running 10.7.2
* Installing from an Administrator account
* 220GB free disk space
I suspect there's a permissions problem with the root account. If I look at the Installer error log I see this:
./preinstall: root is not allowed to run sudo on bruce-joness-macbook-pro.
And of course a few lines later:
Oct 15 12:23:04 bruce-joness-macbook-pro installd[325]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “DeveloperTools.pkg”." UserInfo=0x7f8549b6e410 {NSFilePath=./preinstall, NSURL=file://localhost/Applications/Install%20Xcode.app/Contents/Resources/Packages/DeveloperTools.pkg, PKInstallPackageIdentifier=com.apple.pkg.DeveloperToolsLeo, NSLocalizedDescription=An error occurred while running scripts from the package “DeveloperTools.pkg”.} {
NSFilePath = "./preinstall";
NSLocalizedDescription = "An error occurred while running scripts from the package \U201cDeveloperTools.pkg\U201d.";
NSURL = "file://localhost/Applications/Install%20Xcode.app/Contents/Resources/Packages/DeveloperTools.pkg";
PKInstallPackageIdentifier = "com.apple.pkg.DeveloperToolsLeo";
}
Oct 15 12:23:04 bruce-joness-macbook-pro installer[314]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “DeveloperTools.pkg”." UserInfo=0x7f81acd03770 {NSFilePath=./preinstall, NSURL=file://localhost/Applications/Install%20Xcode.app/Contents/Resources/Packages/DeveloperTools.pkg, PKInstallPackageIdentifier=com.apple.pkg.DeveloperToolsLeo, NSLocalizedDescription=An error occurred while running scripts from the package “DeveloperTools.pkg”.}
Oct 15 12:23:05 bruce-joness-macbook-pro installer[314]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
I've added this line to my /etc/sudoers (it was empty)
root
All = (ALL) ALL
and still no loving. I tried the "sudo open" trick listed above, thinking that looked promising, but still no love.
I don't have any iTunes processes running.
I REALLY don't want to have to wipe this computer, reinstall everying and restore all of my stuff. Anyone else have any other ideas?