packages icon indicating copy to clipboard operation
packages copied to clipboard

calling uninstall script from a package when user drag-and-drop the app

Open iradization opened this issue 3 years ago • 1 comments

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 ?

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 ?

Thanks

iradization avatar Dec 03 '22 19:12 iradization

There is no such thing.

Among the usual solutions:

  • provide a shell script and instructions to remove the different components.
  • write a small app to uninstall the different components (most of the time this is just a wrapper for the shell script in the first solution),
  • create an uninstall package with an empty payload and a pre- or post-installations script that will uninstall the components (again this is mostly a wrapper for the shell script in the first solution to avoid dealing with the admin authentication stuff).

packagesdev avatar Dec 04 '22 23:12 packagesdev