• 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
Re: Best approach to write an uninstaller for osx
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best approach to write an uninstaller for osx


  • Subject: Re: Best approach to write an uninstaller for osx
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 20 Nov 2009 23:26:57 -0800

On Nov 20, 2009, at 11:03 PM, Parimal Das wrote:

> I want to write a uninstaller for my app.

Are you sure it needs one? Most Mac apps don't have or need uninstallers. If you want to remove an app, you just drag its icon to the Trash. (There might be some preference files left behind, but they're not usually big enough to worry about.)

> What this un-installer need to do is- delete some files an the main app, and
> then delete itself.
> Steps what i found are
> 1. Un-install app will run a shell script to delete all.
> 2. It will use launchd to delete itself.

I don't think you need anything fancy to delete yourself. In Unix it's legal to delete an open file; the file contents don't actually get deleted until the last open file handle is closed.

Please be really, really careful about quoting paths in the shell script — the application may be installed in a location that has spaces or quotes in its name, so test those cases. The horrible example is an early iTunes installer script that would accidentally delete your home directory (or was it the entire disk?) if the name of the startup disk had a space in it.

—Jens_______________________________________________

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: Best approach to write an uninstaller for osx
      • From: Parimal Das <email@hidden>
References: 
 >Best approach to write an uninstaller for osx (From: Parimal Das <email@hidden>)

  • Prev by Date: Re: [SOLVED] CoreData/NSPersistentDocument initialization
  • Next by Date: NSFetchedResultsController with fetch predicate
  • Previous by thread: Best approach to write an uninstaller for osx
  • Next by thread: Re: Best approach to write an uninstaller for osx
  • Index(es):
    • Date
    • Thread