2

I'm storing information in a custom property sheet for one of my custom products (I'm then using that information in a javascript file). I want this product to uninstall cleanly, but I can't seem to figure out how to remove a custom property sheet on uninstall using genericsetup. I know that remove="True" doesn't work, but I'm not having much luck figuring out the correct way (or any way for that matter) for removing this. Any suggestions would be greatly appreciated.

keiththomps
  • 8,005
  • 3
  • 15
  • 17

1 Answers1

4

This is confusing for at least two reasons:

  • We have both "old style" and "new style" technologies actively in use. Old style refers to Extensions/Install.py (Python code) and new style refers to profiles/default (GS XML + setuphandlers.py Python code).

  • Successfully installing and uninstalling add-ons in all possible cases still requires the use of both old and new style technologies.

If you don't care about uninstall, you never need to use Extensions/Install.py. If you do care about uninstall, create an Extensions/Install.py with install and uninstall methods. Also create an "uninstall" profile (in addition to the "default" profile) e.g. profiles/uninstall. Configure the Extensions/Install.py:install() method to execute your "normal" profiles/default steps on installation. Now comes the "fun" part.

Because some technologies can be uninstalled "properly" via GS i.e. they respect the remove=True parameter, your Extensions/Install.py:uninstall() method should execute the "proper" GS profiles to do the uninstall. But if your add-on uses technologies that cannot be uninstalled "properly" via GS i.e. those that do not respect the remove=True parameter, then you will need to write Python code to perform the uninstall.

See:

for more information.

aclark
  • 4,345
  • 1
  • 19
  • 31
  • I've actually got all of this implemented already and my question really relates to the python code that is needed for removing a property sheet, I really have no idea where to start on that and I was wondering if anyone knew of some resources for learning about that. As far as I've seen all information relating to uninstalling a product has the above stated info, but nothing says anything about properties other than `remove="True"` doesn't work. – keiththomps Oct 11 '11 at 15:04
  • That's because the properties API has nothing to do with installing/uninstalling (which is really a CMF concept). Try using collective.recipe.omelette or Products.DocFinderTab to discover methods on your object e.g. http://x.aclark.net/plone/4.2.x/develop.cfg – aclark Oct 11 '11 at 17:25