Dealing with “Installation failed” in pkgbuild caused by a preinstall/postinstall bash script

So I was writing an installer for the SmoothMouse kernel extension using pkgbuild/productbuild and there was one bug which I couldn’t get my head around for a couple of hours. Basically, Apple Installer always reported failed installation (without any useful explanation) after running a very simple bash script that unloads my kext.

…but then a moment of enlightment suddenly occured to me!

This entry was posted in Journal and tagged , , , . Bookmark the permalink.

4 Responses to Dealing with “Installation failed” in pkgbuild caused by a preinstall/postinstall bash script

  1. Johann says:

    lol!! that’s what I call product assistance!!

  2. vi4m says:

    Please check what is the return code of sudo/kextunload.
    Instead of

    echo

    just do
    exit 0 would be good as well.

  3. Mark says:

    You can log to the console with:
    function log {
    read message
    syslog -s -k \
    Facility "com.apple.console" \
    Level "Notice" \
    Sender "Angelbird Wings W1 Driver and PrefPane Uninstaller" \
    Message "${message}"
    }

    And use it like this:
    echo "Begin uninstalling" | log

Leave a Reply

Your email address will not be published. Required fields are marked *