Search code examples
macospackagemaker

MacOS packagemaker with post scripts + extra installs


So I'm trying to create a package as a mean of distribution for my project (developed in Python). So far all the dependencies and installs of smaller components are done by the means of an install.sh that is in $PROJECTDIR/main/trunk. This works fine when i run it from it's folder.

Now for creating the package I dropped the whole $PROJECTDIR into PackageMaker and after I added install.sh as a postinstall script. The package was created with no errors. Now if I try to install however, the $PROJECTDIR is copied where it is suppose to but an error occurs when running the script.

So my first question would be:

  1. Is there any way to see where the script failed? Because the only thing I get is run script failed.
  2. What should I be carefull for// what is different between running the script from the folder manually and the script being run from Installer? The script mostly contains some cd's and some python setup.py install.

Regards, Bogdan


Solution

  • Ok so the way I handled this was to use echo >> ~/some_file.txt for the debugging because MacOS installer doesn't have any kind of debugging for script files.

    As for the second problem, if someone runs into this, you need to be carefull with your script to satisfy the following:

    1. Dont forget the #!bin/sh
    2. You have to name it properly (eg. postflight.sh if you want a postflight)
    3. Make sure you have the right flags set for executable.