eveningnick eveningnick <mailto:eveningn...@gmail.com> wrote (Tuesday, January 4, 2011 10:55 AM -0800):

Thanks everyone for advices!

2011/1/4 James Bucanek <subscri...@gloaming.com>:
In my application, I have a special "Uninstall and Quit" menu item. I
shutdown and delete launchd configuration files and them move the active
components (plug-ins, helpers, ...) to the trash. I find this avoid the
problem of deleting files that are part of a bundle (for the plug-ins) that
is still in use, and my customers like the transparency of seeing what was
removed and being given the control over when they're ultimately deleted.

James, how do you delete launchd conf files?

That's actually the easy part. After stopping and unloading the daemon via launchd/launchctl, its configuration file can simply be deleted.

Did you delegate all such
operations to a helper tool, and launch that tool using
AuthorizationExecuteWithPrivileges ?

As it happens, all of my installation and removal is performed by my helper tool which can be launched via AuthorizationExecuteWithPrivileges to do the hard stuff.

I have a freeware product, that's a bit long in the tooth now, but its a Cocoa app that launches a shell script as root. If you're interested in that code I could probably dig it up.

I have written an uninstaller script, and now looking for a way to
"integrate" it in my non root application with "Quit and uninstall"
button. (This non root app is not writable by anyone but root).

I have a number of utility scripts that are launched from a Cocoa app. I typically write the script to a temporary directory and execute it there. In one case, the script turns around and quits the application (using osascript) before doing its thing.

What i have thought so far, is to create a helper tool, with a
system("here is the content of my uninstalling script file") call,
then i am going to launch it using AuthorizationExecuteWithPrivileges.
I don't know if it's the right way though.

I don't know if it's the "right way", but something like this has worked well for me in the past.

--
James Bucanek

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to