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!
lol!! that’s what I call product assistance!!
Please check what is the return code of sudo/kextunload.
Instead of
echo
just do
exit 0 would be good as well.
Thanks for the tip! I’ve updated the scripts.
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