Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/__init__.py
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/__init__.py	(revision 949)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/__init__.py	(revision 956)
@@ -1,8 +1,5 @@
-import logging
-
 from zope.i18nmessageid import MessageFactory
 
 from AccessControl import allow_module, ModuleSecurityInfo
-from Products.CMFCore.DirectoryView import registerDirectory
 from Products.CMFCore.utils import ToolInit
 
@@ -16,6 +13,4 @@
 allow_module('quintagroup.plonecaptchas.config')
 
-registerDirectory('skins', config.GLOBALS)
-
 def initialize(context):
     ToolInit(meta_type="CaptchaTool",
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/config.py
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/config.py	(revision 949)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/config.py	(revision 956)
@@ -1,4 +1,5 @@
 GLOBALS = globals()
 PRODUCT_NAME = 'quintagroup.plonecaptchas'
+CAPTCHA_KEY = 'captcha_key'
 CAPTCHAS_COUNT = 165
 
@@ -21,9 +22,2 @@
 DEFAULT_OFFSET = (0.5, 0.5)
 DEFAULT_DISTORTION = [DEFAULT_PERIOD, DEFAULT_AMPLITUDE, DEFAULT_OFFSET]
-
-PROPERTIES = (('image_size', DEFAULT_IMAGE_SIZE, 'int'),
-              ('background', DEFAULT_BG, 'string'),
-              ('font_color', DEFAULT_FONT_COLOR, 'string'),
-              ('period', DEFAULT_PERIOD, 'float'),
-              ('amplitude', DEFAULT_AMPLITUDE, 'float'),
-              ('random_params', True, 'boolean'))
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/configure.zcml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/configure.zcml	(revision 949)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/configure.zcml	(revision 956)
@@ -3,4 +3,6 @@
     xmlns:five="http://namespaces.zope.org/five"
     xmlns:i18n="http://namespaces.zope.org/i18n"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    xmlns:gs="http://namespaces.zope.org/genericsetup"
     i18n_domain="quintagroup.plonecaptchas">
 
@@ -11,3 +13,19 @@
     <five:registerPackage package="." initialize=".initialize" />
 
+    <!-- File System Directory Views registration -->
+    <cmf:registerDirectory name="captchas" />
+    <cmf:registerDirectory name="captchas_discussion" />
+    <cmf:registerDirectory name="captchas_join_form" />
+    <cmf:registerDirectory name="captchas_sendto_form" />
+    <cmf:registerDirectory name="plone_captchas" />
+
+    <gs:registerProfile
+        name="default"
+        title="quintagroup.plonecaptchas"
+        directory="profiles/default"
+        description="This product adds captcha support to Plone."
+        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
+        provides="Products.GenericSetup.interfaces.EXTENSION"
+        />
+
 </configure>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/controlpanel.xml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/controlpanel.xml	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/controlpanel.xml	(revision 956)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<object name="portal_controlpanel"
+        meta_type="Plone Control Panel Tool"
+        xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+        i18n:domain="quintagroup.plonecaptchas">
+  <configlet title="Plone captchas setup"
+             action_id="prefs_captchas_setup_form"
+             appId="quintagroup.plonecaptchas"
+             category="Products"
+             condition_expr=""
+             url_expr="string:${portal_url}/prefs_captchas_setup_form"
+             visible="True"
+             i18n:attributes="title">
+    <permission>Manage portal</permission>
+  </configlet>
+</object>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/import_steps.xml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/import_steps.xml	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/import_steps.xml	(revision 956)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<import-steps>
+  <import-step id="quintagroup.plonecaptchas.various"
+               version="20090403-01"
+               handler="quintagroup.plonecaptchas.setuphandlers.setupVarious"
+               title="quintagroup.plonecaptchas: various import steps">
+    Various import steps that are not handled by GS import/export
+    handlers.
+  </import-step>
+</import-steps>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/metadata.xml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/metadata.xml	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/metadata.xml	(revision 956)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>2.0</version>
+</metadata>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/propertiestool.xml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/propertiestool.xml	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/propertiestool.xml	(revision 956)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<object name="portal_properties" meta_type="Plone Properties Tool">
+ <object name="qPloneCaptchas" meta_type="Plone Property Sheet">
+  <property name="title">qPloneCaptchas Properties</property>
+  <property name="image_size" type="int">27</property>
+  <property name="background" type="string">gray</property>
+  <property name="font_color" type="string">black</property>
+  <property name="period" type="float">0.1</property>
+  <property name="amplitude" type="float">5.0</property>
+  <property name="random_params" type="boolean">True</property>
+ </object>
+</object>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/quintagroup.plonecaptchas_various.txt
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/quintagroup.plonecaptchas_various.txt	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/quintagroup.plonecaptchas_various.txt	(revision 956)
@@ -0,0 +1,1 @@
+This file is used as a marker in setuphandlers.py.
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/skins.xml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/skins.xml	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/skins.xml	(revision 956)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<object name="portal_skins">
+
+  <object name="captchas"
+          meta_type="Filesystem Directory View"
+          directory="quintagroup.plonecaptchas:skins/captchas" />
+  <object name="captchas_discussion"
+          meta_type="Filesystem Directory View"
+          directory="quintagroup.plonecaptchas:skins/captchas_discussion" />
+  <object name="captchas_join_form"
+          meta_type="Filesystem Directory View"
+          directory="quintagroup.plonecaptchas:skins/captchas_join_form" />
+  <object name="captchas_sendto_form"
+          meta_type="Filesystem Directory View"
+          directory="quintagroup.plonecaptchas:skins/captchas_sendto_form" />
+  <object name="plone_captchas"
+          meta_type="Filesystem Directory View"
+          directory="quintagroup.plonecaptchas:skins/plone_captchas" />
+
+  <skin-path name="*">
+    <layer name="captchas"
+           insert-after="custom" />
+    <layer name="plone_captchas"
+           insert-after="custom" />
+    <layer name="captchas_discussion"
+           insert-after="custom" />
+    <layer name="captchas_sendto_form"
+           insert-after="custom" />
+    <layer name="captchas_join_form"
+           insert-after="custom" />
+    <layer name="plone_captchas/static"
+           insert-after="custom" />
+  </skin-path>
+
+</object>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/toolset.xml
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/toolset.xml	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/profiles/default/toolset.xml	(revision 956)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<tool-setup>
+  <required tool_id="portal_captchas"
+            class="quintagroup.plonecaptchas.CaptchaTool.CaptchaTool"/>
+</tool-setup>
Index: quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/setuphandlers.py
===================================================================
--- quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/setuphandlers.py	(revision 956)
+++ quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/setuphandlers.py	(revision 956)
@@ -0,0 +1,22 @@
+from random import randint
+
+from quintagroup.plonecaptchas.config import CAPTCHA_KEY
+
+def generateKey(length):
+    key = ''
+    for i in range(length):
+        key += str(randint(0, 9))
+    return key
+
+def setupVarious(context):
+    if context.readDataFile('quintagroup.plonecaptchas_various.txt') is None:
+        return
+
+    site = context.getSite()
+
+    # set captcha key
+    value = generateKey(8)
+    if site.hasProperty(CAPTCHA_KEY):
+        site._updateProperty(CAPTCHA_KEY, value)
+    else:
+        site._setProperty(CAPTCHA_KEY, value, 'string')
