Re: Writing an Uninstaller
Re: Writing an Uninstaller
- Subject: Re: Writing an Uninstaller
- From: Rajendran P <email@hidden>
- Date: Wed, 27 Oct 2010 19:37:46 +0530
- Acceptlanguage: en-US
- Thread-topic: Writing an Uninstaller
There is possibility that user might restore the app from trash to /Application :) just ensure that launchd is added after the App launch
Thanks
Rajendran P
On 10/27/10 7:22 PM, "Angus Hardie" <email@hidden> wrote:
On 27 Oct 2010, at 13:16, eveningnick eveningnick wrote:
> Hello
> I have an application that creats, when installed, a bundle in
> "Applications" and registers a .plist file for launchd in
> ~/Library/LaunchAgents (the agent is located in that bundle, and its
> process is launched everytime the OS starts).
> Thus, i can't let a user just to move bundle to the Trash bin, when he
> wants to get rid of it. Thats why, in a "control panel" of my
> application, i placed a button "Uninstall", which
> 1) stops the Agent
> 2) deletes the plist file
> 3) [should delete the bundle]
>
> This control panel is located in this bundle, that has to be deleted.
> And in Mac OS 10.6 a bundle whose application is running can't be
> deleted.
> What could i do here to delete the bundle? What is usually done in such cases?
> o) After "uninstalling", ask user to manually move bundle to a trash
> bin, and then terminate control panel application? Seems pathetic,
> especially when user already pressed "Uninstall".
> o) Copy a "bundle-deleting script" to the "autorun once", that will
> launch next time with the next system boot? It seems like a good idea,
> but could it be done somehow without leaving traces afterwards?
> o) Copy to some "autocleanined" (like temp or something) folder a
> script, launch it and terminate control application. That script will
> wait, till the control app is terminated , and then remove the bundle.
> But does such a folder exist in MacOS? and how could it possibly be
> done?
>
> I don't want to rubbish the user's Mac, if he/she doesn't like my App :)
>
Have you considered just killing the background process and then automatically moving your app to the trash before quitting?
It's simple and most end users understand the idea of old apps ending up in the trash. (If they even notice it at all)
(Using NSWorkspace)
Alternatively using launchd and WatchPaths to watch for the user moving your app out of its proper location
and then automatically kill the background process and delete the launchd scripts.
I believe Sparkle uses the first approach to replace existing applications while Steam on the Mac does something like the latter.
Angus
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden