• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Application that uninstalls itself
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Application that uninstalls itself
      • From: James Bucanek <email@hidden>
    • Re: Application that uninstalls itself
      • From: Macdev <email@hidden>
    • Re: Application that uninstalls itself
      • From: Scott Ribe <email@hidden>
    • Re: Application that uninstalls itself
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Highlighted Text in PDF Kit
  • Next by Date: Re: Application that uninstalls itself
  • Previous by thread: Highlighted Text in PDF Kit
  • Next by thread: Re: Application that uninstalls itself
  • Index(es):
    • Date
    • Thread