Application that uninstalls itself
Application that uninstalls itself
- Subject: Application that uninstalls itself
- From: eveningnick eveningnick <email@hidden>
- Date: Mon, 3 Jan 2011 17:48:07 +0200
Hello
I am writing an application that for users convenience has a button "Uninstall".
Inside, this "uninstaller" stops several launchd services,
"kextunloads" a driver, deletes this driver and services and finally
is supposed to delete itself.
In any sane operating system it is impossible (at least, directly) for
an application to remove a file that is running.
Hence i am searching for a detour.
The uninstaller is a helper tool, which has a suid bit set. I am
fork/exec'ing this helper tool when a user clicks "Uninstall" button
in System Preferences custom preference pane.
The only way i am seeing how to completely remove everything my
installer had installed, and to remove the preference pane (that
contains settings and this "Uninstall" button) itself, is to delegate
"unlinking" of files to some external tool - like AppleScript
(fork/exec the "osascript" and terminate the parent process). But
then, i am unsure about privileges issue.
Should i be calling osascript with AuthorizationExecuteWithPrivileges?
But the what happens if my uninstaller application terminates right
after it calls this function? (i need to terminate it, to let the
script delete uninstaller's executable).
Could you give me some hints on where to look and what would be the
best approach?
Thank you!
_______________________________________________
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