Plone 3 Products Development Cookbook
上QQ阅读APP看书,第一时间看更新

Installing Plone on Windows

As with Linux and Mac, there is also a Windows unified installer (based on the buildout method described above) available, which provides the easiest way to install Plone in a Windows environment.

Download the latest Plone release from http://plone.org/download (3.3.4 at the time of writing) and run it.

Installing Plone on Windows

This installation process is an easy four-step wizard that will guide you through:

  1. A welcome screen, as shown in the screenshot.
  2. The choice for the destination path for Plone (c:\Program Files\Plone, by default).
  3. The configuration of the Zope instance administrator account (read: username and password).
  4. A confirmation screen.

As a way of learning the buildout approach, which we introduced in the last two recipes, you are encouraged to go through the buildout.cfg file created in the chosen destination folder.

Although this method is really straightforward, if you plan to use several buildouts, Windows installer is unlikely to be the best solution, as it will reinstall the whole bundle, including the Python interpreter, every single time you create a new buildout.

As we have covered for Linux, we will see here the manual installation method to create a Zope instance on a Windows system.

How to do it…

  1. Install the required Python version: If you are planning to create a Plone 4.x site, you will need Python 2.6. If not, Python 2.4 is required. Download the Windows Python installer from http://www.python.org/download/windows and run the installer.
  2. By adding Python directory to the PATH environment variable, we can reuse the Python installation for other development buildouts. We are assuming here that you have installed Python 2.4 in the c:\Python24 folder; change the paths according to your directory choices.
    • Go to the Windows Control Panel
    • Open System options. You can get here by pressing the Windows logo key + Pause.
    • Click on the Advanced tab in Windows XP or Advanced system settings in Windows Vista.
    • Then click on the Environment variables button.
    • Find the PATH variable and add c:\Python24;c:\Python24\Scripts.
  3. Install the PyWin32 extension: We also need Python Win32 extensions. Download the correct file for your Python version at http://sourceforge.net/projects/pywin32/files and run the downloaded installer.
  4. Install Python Imaging Library (PIL): download it from http://effbot.org/downloads. Again, pick the relevant installer for your Python version. At the time of writing, PIL-1.1.7.win32-py2.4.exe is the choice for Python 2.4.
  5. Install a C compiler to build Zope: The easiest solution is to install MinGW, obtainable from http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer, and run the installer.

    Note

    We chose c:\MinGW as the installation folder. If you choose a different one, please adjust the next steps.

    After the installation is finished, copy cc1.exe and collect2.exe from the c:\MinGW\libexec\gcc\mingw32\3.4.5 folder to c:\MinGW\bin.

    Now add c:\MinGW\bin to the system PATH environment variable the same way we did with the Python PATH.

  6. Fix the Python compiler problem: Given that the Python-installed version has been compiled on a different machine (we installed the binaries and they are usually compiled with Visual Studio), in order to prevent problems during other packages’ compilation, we must tell our environment to use the just-configured MinGW compiler.

    To do this, create or update the distutils.cfg file in c:\Python24\Lib\distutils (adjust the path to your Python installation directory) with this content:

    [build]
    compiler=mingw32
  7. Create a buildout with paster: As with Linux, we can use ZopeSkel templates to create new buildouts. If you have any doubt about the following commands, refer to the instructions in the Installing Plone on Linux section.

    First download the EasySetup installation file from http://peak.telecommunity.com/dist/ez_setup.py and run

    python ez_setup.py
    

    Now you can use easy_install to install ZopeSkel, and then create the buildout:

    easy_install ZopeSkel
    paster create -t plone3_buildout
    cd pox
    python bootstrap.py
    bin\buildout.exe
    

See also

  • Installing Plone on Linux
  • Installing and configuring an egg repository
  • Writing a production buildout