[Product-Developers] Re: How to test for product reinstallation

Raphael Ritz r.ritz at biologie.hu-berlin.de
Tue Feb 2 15:59:49 UTC 2010


Shane Graber wrote:
> I have a couple products that I'm writing that install portlets and 
> custom views for certain content items.  Is there a way for me to flag 
> that a product is being re-installed in the install/uninstall routine?  
> The way it's written now, it installs (adding portlets and views as 
> needed) and uninstalls (removes portlets and resets all views to their 
> defaults prior to installation).  What I want is some short of flag that 
> I can set in Extensions/Install.py to flag that it's being reinstalled 
> so that it does not remove the portlets and already set views.
> 
> Is there a way to do that?  Any code would be appreciated.  Thanks!

IIRC the install/uninstall methods invoked by the quickinstaller
take an optional argument "reinstall=True" (default false) that
QI (should) use to leave a few things untouched already on reinstall
(available from ZMI). You should be able to check for that flag
and have it set when you invoke 'reinstall' in ZMI.

Raphael


> 
> Shane
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers





More information about the Product-Developers mailing list