0

I'm trying to figure an issue with building an install package for a Mac OS application. It's a simple hello world app and I use pkgbuild to do so.

If I simply package my app with no pre/post install scripts, the app installs fine. However, as soon as I add a preinstall script that does nothing but an echo, the installation fails with no meaningful message:

The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.

This is the command that creates a successful install:

pkgbuild --component HelloMac.app --install-location /Applications  HelloMac${VERSION}.pkg

And this is the one that creates a pkg file that fails:

pkgbuild --component HelloMac.app --install-location /Applications --scripts scripts HelloMac${VERSION}.pkg

I have only one file called preinstall in the scripts folder and it has one line echo "hello"

How can I debug this failure? Or what else am I missing? Does the package need to be signed to run the scripts (mine is not)?

unexplored
  • 1,414
  • 3
  • 18
  • 37
  • I don't know for sure, but I suspect the preinstall script doesn't have a valid stdout, so `echo` gets an error trying to send output to... well, nowhere, causing the script to exit with an error status, so Installer interprets that as meaning installation cannot proceed. – Gordon Davisson Oct 21 '20 at 02:41
  • @GordonDavisson I just replaced the `echo` with `exit 0` and I'm getting the same results, – unexplored Oct 21 '20 at 12:41
  • In that case... I don't know what the problem might be. Is there anything in the installer log? – Gordon Davisson Oct 22 '20 at 07:10
  • Where does the installer log things? I checked the console application for system logs and couldn't find anything relevant. – unexplored Oct 22 '20 at 14:33

0 Answers0