2

I want to run my own uninstallation script related to my Application, when i am trying to move it to trash. I want to get event, to see if move to trash is triggered so that i will run my uninstallation script before moving it to trash

MacDeveloper
  • 1,334
  • 3
  • 16
  • 49
  • Don't quite follow you here. If it's in the trash, it meant the app was not running atm and once it's in the trash, it's not executable due to the trash folder permission. You should let the script remove your app and the related file all at once. – Cai Apr 08 '16 at 17:24
  • You mean i should write this clean removal, out if my app. As once it is moved to trash, it won't execute any of my code – MacDeveloper Apr 08 '16 at 17:56
  • 1
    Yes, that's what I meant. – Cai Apr 08 '16 at 19:55
  • When we try to move an application that is running to trash, we get an popup telling that we can't move to trash as application running. I want to get that event which helps me to show my own custom pop up before moving to trash – MacDeveloper Apr 09 '16 at 02:37
  • If your app is not sandboxed and has a demon running, it could be possible. – Cai Apr 09 '16 at 03:31
  • Yes i have a daemon running – MacDeveloper Apr 09 '16 at 03:39
  • Possible duplicate of [Uninstaller for a cocoa application](http://stackoverflow.com/questions/4377015/uninstaller-for-a-cocoa-application) – rob mayoff Apr 09 '16 at 03:56
  • Try using the demon to monitor the main bundle's location to achieve the goal you want. – Cai Apr 09 '16 at 03:56

0 Answers0