I am using PackageMaker for the installer of my application (which is more than a simple bundle). I am wondering how to create an uninstaller, where to install it and how to pro
While implementing an uninstaller for some MAC OS application, we've come up with an idea. As SerpicoLugNut says:
Seriously - 98% of Mac apps don't offer an uninstaller, and if most people want the app uninstalled, they will just drag the app to the trash
We deviced that we can watch the Trash, and in case our application appears in the Trash, we can ask a user if he/she wants to uninstall it.
Fortunately, the MAC OS provides an out-of-box functionality to implement this. You just have to put the following .plist to the /Library/LaunchAgents:
Label
com.your.app
WatchPaths
~/.Trash
ProgramArguments
osascript
/path/to/your/app/Check Trash.applescript
KeepAlive
In this example, a Check Trash.applescript
is run once the user's Trash is modified. This script should check that your application is in the Trash and ask the user if he/she wants to proceed with the uninstall. Of course this can be an arbitrary script or even a binary executable, not only an applescript. For more information, look at the man page for launchd.plist