My first attempt was to create another profile, called attachment, where I will put the modifications, and running the step from the Install.py. That is:
- create a profiles/attachment/types/Attachment.xml and include there the action I need to add in a proper xml structure.
- register the profile in the main configure.zcml (archgenxml will create a profiles.zcml for this purpose)
<!-- ##code-section profiles.zcml-top #fill in your manual code here -->
<genericsetup:registerProfile
name="attachment"
title="MyProduct-customized-profile"
directory="profiles/attachment"
description="Customized extension profile for MyProduct."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
<!-- ##/code-section profiles.zcml-top -->
- put this code in Extensions/Install.py
from Products.CMFCore.utils import getToolByName
def afterInstall(self, reinstall, product):
portal_setup = getToolByName(self, 'portal_setup')
portal_setup.runAllImportStepsFromProfile('profile-Products.MyProduct:attachment')
But when I installed the product, I got:
BadRequest: The id "import-all-profile-Products.MyProduct_attachment-20080426230436.log" is invalid - it is already in use.
I was importing the steps of a profile that QuickInstaller had already imported. But my product wasn't completely installed yet...
The problem is that QuickInstaller imported the attachment profile not because it imports every step, but because it imports the first registered profile in alphabetical order. At least, that's what I concluded, because, after moving profiles/attachment to profiles/extra, and renaming attachment for extra in the previous fragments of code, it worked.
The default profile wasn't imported. And looking at the installable products on QuickInstaller Control Panel page, the attachment product was listed, instead of the MyProduct profile that used to be there.
So, should I use only names that follows 'default' in lexicograpic order for additional profiles? I would expect that QuickInstaller only executed the default profile. Maybe I missed something... This was the first time I added a second profile.