[Product-Developers] State of uninstall addons in Plone

Maurits van Rees m.van.rees at zestsoftware.nl
Thu Apr 26 08:42:42 UTC 2012


Hi Jean-Michel,

I will add some thoughts.

Op 25-04-12 19:37, Jean-Michel FRANCOIS schreef:
> Hi,
>
> I would like to ask before going into any bad way of doing things.
>
> What is the state of supporting uninstall of addons in Plone ?
>
> Existing documentation I have found:
>
> http://collective-docs.readthedocs.org/en/latest/components/genericsetup.html?highlight=uninstall
> http://plone.org/documentation/kb/genericsetup/creating-an-uninstall-profile
> (marked as outdated)
>
>  From what I understand.
>
> I need to create Extension/install.py with uinstall method  inside
> because QI is not awayre of "uninstall" profile.

Correct.

> Should we make QI support "uninstall" profile ?

Yes. There is a ticket here, which might need to be turned into a PLIP:
https://dev.plone.org/ticket/11328

> Next I see an issue here: "uninstall" is not really defined but I can
> except some behavior as "Integrator" or "Super Plone user"
>
> * Do not drop configuration until it doesn't let you remove the addon
> from the system (I expect if addon is installed back to keep configuration)

If you do not create your own uninstall method, the QI takes care of 
undoing all recorded changes when you uninstall and undoing most 
recorded changes when you reinstall.  Items like portal objects should 
normally be removed when uninstalling but should be kept while reinstalling.

Reinstalling should be less of an issue these days, since we have 
upgrade steps.  But it is still nice if a reinstall does not break 
things, like emptying the the intids catalog.  David Glick did a fix in 
Products.CMFQuickInstaller 3.0.6 (Plone 4.1.5) which helps here, though 
it only works for newly installed add-ons.

> * Remove anything that should broke the site if I want to remove the
> addon from the system.
> * Do not break the content

Indeed.  The ultimate test is to afterwards remove the package from your 
buildout, rerun the buildout, restart Plone and see if anything breaks.

Leaving instances of content types around is probably fine.  It would be 
unexpected if an uninstall removes content items.

The standard QI uninstall code takes care of removing css, javascript 
and a bit more.  I think if you create your own uninstall method you 
should probably let the uninstall profile handle everything.

I have seen some uninstall profiles that are simply the same as the 
default profile.  Apparently some people have the impression that giving 
the profile the name 'uninstall' magically makes the GenericSetup code 
do the opposite.  This is a recent fix I did:
https://github.com/plone/plone.multilingual/commit/b48c48bb5d84a30fa864364eaaf38c5029de86e3


-- 
Maurits van Rees: http://maurits.vanrees.org/
Zest Software: http://zestsoftware.nl



More information about the Product-Developers mailing list