I'm working on some app that has LaunchDaemon running on the background, and thus it requires some operations to be removed, prior to deleting the data/exe files.
Is there an option to call an uninstall script upon drag-and-drop my app into the trash bin ? or at least, prevent the uninstallation and trigger popup window that tells the user this app cannot be removed until he unload the service (
sudo launchctl stop /Library/LaunchDaemons... or
sudo launchctl unload -w /Library/LaunchDaemons...)
my app uses pkg file format for deployment, but I couldn't find any uninstall callback within this format. is there a way to do so ?