Thank you guys for answer, but the problem still remains for me

> HI ,
>   launch an applescript / shell script when uninstall button is clicked . 
> This should first quit  the App and wait for it to terminate and then delete 
> the bundle and plist
> Rajendran P

I'm sorry for asking such a primitive question but could you point me
how can that be done? How can i schedule a script to be executed after
my process is terminated? AppleScript call like

[[[[NSAppleScript alloc] initWithSource:@"tell finder to delete
something"] executeAndReturnError:nil];
[NSApp terminate];

can't do the job, because that -executeAndReturnError doesn't return
unless the launched script has returned. It looks like a deadlock -
the script should wait for my app to terminate, while my app is
waiting for script to terminate

Should i write an another *.plist to "program" launchd to execute a
script? What will it look like then? (by the way, is there a way to
make launchd execute some script without writing and saving a plist to
disk?)
Or what is the right way? What did you mean?

And, deleting my bundle requires Administrator privileges, which my
adhoc uninstaller doesn't have. Should i provide some kind of form to
ask for username and password then, like it is done in
PackageMaker/Installer? Or maybe the system provides some
interface/API for displaying that window? How can i escalate my
uninstaller privilege to be able to delete its own bundle, and its
stuff, that Installer has placed to ~/Library/Application
Support/MyApplication?

Angus, about
>Have you considered just killing the background process and then automatically 
>moving your app to the trash before quitting?

i do kill the daemon, and delete its plist, but how can i delete my
own bundle? the system just doesn't let me, i think because
Uninstaller is an Application from MyBundle.app/Contents/MacOS. Any
other launched binary (for example that background daemon) can be
deleted together with its bundle, but not an Application - it seems to
be protected by Finder or something

Thanks again!
_______________________________________________

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