Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mycompuser

macrumors member
Original poster
May 8, 2012
37
0
Hi All,

My development environment is XCode 4.3.2 on Lion.

My cocoa XCode .app gets installed in the Applications folder.

The app generates debug log files under
/Users/Logged-inUser/Library/Application Support/MyApp/

(logs needed for debugging issues reported by customers)

If I were to drag the application and trash out the same, though the application is uninstalled from the machine, these log files continue to be there.

Is there a mechanism by which I can get notified when the user drags the app to trash for uninstallation so that I can handle the notification to perform necessary cleanup?

Thanks & Regards.
 

charlieegan3

macrumors 68020
Feb 16, 2012
2,394
17
U.K
Not sure if this is possible. Could create an uninstall menu item for them, but they most likely wouldn't use it.

lots of peoples apps leave stuff behind, not that its good, but it is kind of accepted.
 

mycompuser

macrumors member
Original poster
May 8, 2012
37
0
Could create an uninstall menu item for them, but they most likely wouldn't use it.

My app does have this option and when uninstalled via this means the uninstallation is clean.

Wanted to make my app better by doing the necessary cleanup even for drag to trash uninstallation scenario also hence this thread.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
I guess you could have a small helper app running in the background; which watches the Applications (or your app's folder within it, if applicable) for changes. When the main app has been deleted, it deletes the logs etc. It would, of course, leave a helper app lying around.

You could look at FSEvents (a C API) to do this.
 

mycompuser

macrumors member
Original poster
May 8, 2012
37
0
I guess you could have a small helper app running in the background; which watches the Applications (or your app's folder within it, if applicable) for changes. When the main app has been deleted, it deletes the logs etc. It would, of course, leave a helper app lying around.

You could look at FSEvents (a C API) to do this.

Yes, I did think of this solution but then the solution is unacceptable as the helper app will still be there and it defeats the the whole purpose of a clean uninstallation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.