views:

1259

answers:

1

Everything worked on 10.5, but now my PackageMaker installation project is broken. I've been fighting a problem for a few days now, and either

  • Snow Leopard (OS X 10.6.1) has broken PackageMaker installations
  • I am lacking a very, very basic tidbit of knowledge

To narrow down the problem, I've gotten to this point:

  1. Create a new PackageMaker installation
  2. Have it install a jpeg image into my home directoy
  3. Define a preinstall script that does nothing
    #/bin/sh
    exit 0

Run the above...and watch it fail with the below error message like clock work

Sep 14 15:09:45 manoa installd[5620]: PackageKit: ----- Begin install -----
Sep 14 15:09:45 manoa installd[5620]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Sep 14 15:09:45 manoa installd[5620]: PackageKit: packages=(\n    "PKLeopardPackage <file://localhost/Users/stu/Desktop/asdf.pkg>"\n)
Sep 14 15:09:46 manoa installd[5620]: PackageKit: Extracting /Users/stu/Desktop/asdf.pkg (destination=/var/folders/Hb/HbXJFyEpFaupt5QyLN-pTk+++TI/-Tmp-/PKInstallSandbox-tmp/Root/~, uid=501)
Sep 14 15:09:46 manoa installd[5620]: PackageKit: Executing script "./preinstall" in /private/tmp/PKInstallSandbox.cmlS2H/Scripts/test.test.5year_header.pkg.PFrHNB
Sep 14 15:09:46 manoa installd[5620]: PackageKit: *** launch path not accessible
Sep 14 15:09:46 manoa installd[5620]: PackageKit: Install Failed: PKG: pre-install scripts for "test.test.5year_header.pkg"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x100149430 "An error occurred while running scripts from the package “asdf”." {\n    NSFilePath = "./preinstall";\n    NSLocalizedDescription = "An error occurred while running scripts from the package \U201casdf\U201d.";\n    NSURL = "file://localhost/Users/stu/Desktop/asdf.pkg";\n    PKInstallPackageIdentifier = "test.test.5year_header.pkg";\n}
Sep 14 15:09:46 manoa Installer[5614]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 UserInfo=0x1195917c0 "An error occurred while running scripts from the package “asdf”."
Sep 14 15:09:46 manoa Installer[5614]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Sep 14 15:09:47 manoa Installer[5614]: IFDInstallController 144040 state = 7
Sep 14 15:09:47 manoa Installer[5614]: Displaying 'Install Failed' UI.
Sep 14 15:09:47 manoa Installer[5614]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.

There is no file in /private/tmp/PKInstallSandbox.cmlS2H/Scripts/test.test.5year_header.pkg.PFrHNB/, which makes me think the problem is with PackageMaker, and not me. But I'm new to the world of OS X software installation, so doubts remain.

So, the question: Is PackageMaker with a preinstall script broken on OS X 10.6? Or is there some requirement regarding preinstall scripts that I do not understand?

A: 

I'm having the very same issue. I'm also new to Mac OS X development, though I had this very same package working on 10.5. It's strange to me that it doesn't even load the first echo of the script. It seems to fail to even run it at all. I've checked on the permissions of the file and set them to 777 for the heck of it, and still no love. The other thing that disturbs me, is I see the same exact thing in your console log as I do in mine which is:

Error Domain=PKInstallErrorDomain Code=112 UserInfo=0x100129a00 "An error 
occurred while running scripts from the package “BlackBox 0.17”.
"NSFilePath = "./postinstall";

It's the last bit there that bothers me: "./postinstall". Where did my ".sh" go? I would assume it should still be there somewhere. (quick edit: I just used pacifist to inspect the contents of the built package, and it shows postinstall without the ".sh" so maybe that's normal)

Did you ever ever discover the problem? If so, please post, if not hopefully something here triggers something in your brain to make it work.

Also, considering that this same package managed to run the script in 10.5, maybe it's the installer app that has the issue, rather than package maker.

counterbeing
I never did find out what the issue was. We gave up and have gone with an entirely different strategy for deploying our application that does not require any scripts to run. I keep hoping someone will show up with an answer. Apparently others consider Package Manager cwap. See a related question of mine: http://stackoverflow.com/questions/1378443/is-packagemaker-considered-the-standard-for-os-x-software-installation-or-is-th
Stu Thompson