As a service to my users I would like to provide an uninstall script to completely remove all traces of my application on Mac OS X. The application is installed using a package rather than just being dragged into the Applications folder because it is a daemon-type app that also requires to run a script at installation to be launched.
My thinking is to include a file called uninstall.sh
and place it into /Library/Application Support/com.<mycompany>.<myapplication>/
and refer to this from the application documentation. The purpose is basically to stop the daemon if running, unload and delete the corresponding plist as well as remove any application files. Does this sound reasonable or are there better methods to accomplish this?
Also I am wondering if it is good practice to also remove traces of the package using pkgutil --forget
- if I don't do this, the next time the package is installed it shows up as being upgraded instead of installed. Any recommendations or pointers to best-practice information?
Is there no standard way of doing this on OS X?