How to create a package uninstaller

Michael O'Brien Michael.T.OBrien at notes.aero.org
Wed Oct 19 13:43:15 PDT 2011


On Oct 18, 2011, at 4:03 PM, Ryan Schmidt wrote:

> We should keep the discussion on the list; use "Reply All" when you reply.
> 
> 
> On Oct 18, 2011, at 17:23, Michael O'Brien wrote:
> 
>> On Oct 18, 2011, at 3:03 PM, Ryan Schmidt wrote:
>> 
>>> On Oct 18, 2011, at 16:54, Michael O'Brien wrote:
>>> 
>>>> So, question: If I use Macports to create a package file, or a metapackage file, how can I then create an UN-installer for it?
>>> 
>>> As was already said, OS X does not include an uninstaller. There are some 3rd-party uninstallers available I think. They read the bom files (bill of materials) the installer leaves behind. On Snow Leopard and later, you can find the bill of materials files in /var/db/receipts. On Leopard and earlier, they're in /Library/Receipts.
>>> 
>>>> I don't want to just blindly remove all of /opt/local.  I just want to remove exactly the set of files that were installed by the (meta)package.
>>> 
>>> If you distribute a binary package, please create the package from a MacPorts installation whose prefix is NOT /opt/local, otherwise you will interfere with users who want to also use MacPorts.
>> 
>> The package is for use ONLY on Macs which do NOT have MacPorts installed.  We tried moving the directory and ran into too many problems.  Those who have Macports installed get to use the actual Portfile, or (when ports gets upgraded) the generated archives.
>> 
>> I'm grotting around looking for the receipt files now.  Thanks!  I hadn't realized they'd moved.
> 
> I understand that your intention is that your installer only be used by people who don't use MacPorts. Indeed that would be the point of most binary installers. But users' needs change; perhaps a user who does not currently use MacPorts will want to in the future, and they might not know how to uninstall your version, might not know that they should uninstall your version first, or might not even remember that they had installed your version at all. We've already fielded so many problem reports from users in this situation that we have a wiki entry about it:
> 
> https://trac.macports.org/wiki/ProblemHotlist#xmlwf
> 
> We would appreciate it if you would not increase our future support workload, and pick a different prefix for your binaries, such as /opt/yourpackage or /usr/local/yourpackage. That is: install a fresh MacPorts, built from source, with "./configure --prefix=whatever". Then build your packages using that MacPorts. I would not anticipate that you would run into any problems by doing so.

The package has already been deployed, so that horse has left the barn.  Installation of MacPorts should, as I understand it, be stone ignorant of existing packages installed sans MacPorts; they're not in the MacPorts installed-package DB, assuming it has one.  If it doesn't, then oops.  Frankly, it's one reason why we'd like an uninstaller.


More information about the macports-users mailing list