=====================
Installing on Windows
=====================

Before You Begin
================

Review Board is provided as downloadable packages through
`Python setuptools`_. The easy part is installing Review Board itself. The
harder part is installing some of the dependencies, which we have less control
over. This guide will help with some of these dependencies.

It's assumed that you know which database and web server you want to use,
and have already installed these on your server.

Review Board supports the following database servers:

* MySQL_ v5.0.31 or newer
* PostgreSQL_
* sqlite_ v3

And the following web servers:

* Apache_ + mod_python or fastcgi
* lighttpd_ + fastcgi


.. _`Python setuptools`: http://peak.telecommunity.com/DevCenter/setuptools

.. _MySQL: http://www.mysql.com/
.. _PostgreSQL: http://www.postgresql.org/
.. _sqlite: http://www.sqlite.org/
.. _Apache: http://www.apache.org/
.. _lighttpd: http://www.lighttpd.net/


Installing Python Support
=========================

You can install Python by running the latest `Python 2.5 Installer`_ for
Windows.

You'll then need to run the latest `Python Setuptools Installer`_ (look
toward the bottom of the page for the file listing).

Once Python and Setuptools are installed, you'll need to add a couple
directories to your system path.

1. Open :menuselection:`Start --> Control Panel` and navigate to the
   :guilabel:`System` icon.
2. Click on the :guilabel:`Advanced` tab.
3. Click :guilabel:`Environment Variables`.
4. Find :envvar:`PATH` in :guilabel:`System variables` and click
   :guilabel:`Edit`.
5. Add ``;C:\Python25;C:\Python25\Scripts`` (substitute your Python
   directory if it's not ``C:\Python25``) to the end of the list.

.. _`Python 2.5 Installer`: http://python.org/download/releases/2.5.4/
.. _`Python Setuptools Installer`: http://pypi.python.org/pypi/setuptools#windows


.. index:: patch.exe

Installing patch
================

In order to view diffs, you'll need to install GNU :command:`patch.exe`.

You can `download the installer
<http://gnuwin32.sourceforge.net/downlinks/patch.php>`_ for GNU
:command:`patch.exe`. Follow the instructions in the installer and make sure
:command:`patch.exe` in your PATH.

.. warning::

   If you have a non-GNU version of :command:`patch.exe` in your path
   (such as one from Visual Studio), you will run into problems. You will
   need to make sure the user your web server is running as sees the
   GNU :command:`patch.exe` only.


.. index:: memcached

Installing memcached
====================

Memcached_ is a high-performance caching server used by Review Board. While
optional, it's **strongly** recommended in order to have a fast, responsive
server. Along with memcached, we need the `python-memcached`_ Python bindings.

1. Download `memcached for Windows`_.
2. Unzip this to the directory you want to keep memcached in (for example,
   :file:`C:\\memcached`).
3. If running Vista, you'll need to set this to run as an administrator.
   Right-click on :file:`memcached.exe` and click :guilabel:`Properties`.
   Click the :guilabel:`Compatibility` tab and then check
   :guilabel:`Run this program as an administrator`.
4. Install the service from the command line by typing the following from
   the memcached directory::

      memcached.exe -d install

5. Start the server through the Microsoft Management Console.
6. Install `python-memcached`_ by typing the following::

      easy_install python-memcached

.. _`memcached for Windows`: http://code.jellycan.com/memcached/
.. _memcached: http://www.danga.com/memcached/
.. _`python-memcached`:
   http://www.tummy.com/Community/software/python-memcached/


Installing Python Imaging Library
=================================

Review Board requires the Python Imaging Library (PIL). To install this,
download the latest version that matches your Python version at the
`PIL website`_.

.. _`PIL website`: http://www.pythonware.com/products/pil/


Installing PyCrypto
===================

Review Board requires PyCrypto_ for SSH repository support. To install this,
download the latest version that matches your Python version at the
`PyCrypto Win32 downloads page`_.

.. _PyCrypto: http://www.pycrypto.org/
.. _`PyCrypto Win32 downloads page`:
   http://www.voidspace.org.uk/python/modules.shtml#pycrypto


Installing Review Board
=======================

To install Review Board and its required dependencies (Djblets,
`Django-Evolution`_, Django_, and paramiko_, flup_) in one go, type::

    easy_install ReviewBoard


This will automatically download and install the latest stable release of
Review Board and the required versions of its core dependencies.

If you want to install an in-development release, see
:ref:`installing-development-releases`.


.. _`Django-Evolution`: http://django-evolution.googlecode.com/
.. _Django: http://www.djangoproject.com/
.. _paramiko: http://www.lag.net/paramiko/
.. _flup: http://trac.saddi.com/flup


Installing Database Bindings
============================

Depending on the database you plan to use, you will probably need additional
bindings.


MySQL
-----

To install, type::

    $ easy_install mysql-python


PostgreSQL
----------

To install, type::

    $ easy_install psycopg2


SQLite
------

.. note:: If you have Python 2.5 or higher, you already have SQLite and won't
          need to install this.

To install, type::

    $ easy_install pysqlite


Installing Source Control Components
====================================

Depending on which source control systems you plan to use, you will need
some additional components.


CVS
---

To use Review Board with CVS_, you'll need :command:`cvs.exe` in your
path. You can either install this through Cygwin_ or by downloading the latest
version from the `Windows CVS releases`_ page.

.. _Cygwin: http://www.cygwin.com/
.. _CVS: http://www.nongnu.org/cvs/
.. _`Windows CVS releases`:
   http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/


Git
---

Git_ can be installed on Windows through Cygwin_ or by using the
msysGit_.

.. _Git: http://www.git-scm.com/
.. _msysGit: http://code.google.com/p/msysgit/


Mercurial
---------

Mercurial_ can be installed on Windows through Cygwin_ or by using the
`Windows Mercurial packages`_.

.. _Mercurial: http://mercurial.selenic.com/
.. _`Windows Mercurial packages`: http://mercurial.berkwood.com/


Perforce
--------

Perforce_'s :command:`p4.exe` must be installed in the path. You can
download this from the `Perforce downloads`_ page.

You will also need to install the P4Python from the
`Perforce FTP site`_. Find the server version number needed and proceed
to the :file:`bin.cygwinx86` directory.

Note: Your mileage may vary with installing P4Python. You may need to
consult the Perforce website for further instructions.


.. _Perforce: http://www.perforce.com/
.. _`Perforce downloads`: http://perforce.com/perforce/downloads/
.. _`Perforce FTP site`: ftp://ftp.perforce.com/perforce/


Subversion
----------

Subversion_ can be installed from Cygwin_ or by downloading the latest
installer from the `Subversion downloads`_ page. Make sure Windows is
selected, and then choose the ``CollabNet Subversion Command-Line Client``.

You will then need to install PySVN_ from the `PySVN downloads`_ page.


.. _Subversion: http://subversion.apache.org/
.. _PySVN: http://pysvn.tigris.org/
.. _`Subversion downloads`:
   http://www.open.collab.net/downloads/subversion/
.. _`PySVN downloads`:
   http://pysvn.tigris.org/servlets/ProjectDocumentList?folderID=1768


Installing Amazon S3 Support (optional)
=======================================

This is an optional step.

Review Board can use `Amazon S3`_ to store uploaded screenshots. To install
this, you will need the :mod:`django-storages` module. Type::

    $ easy_install django-storages

After you've installed Review Board and created your site, you will need
to configure this. See the :ref:`file-storage-settings` documentation for
more information.

.. _`Amazon S3`: http://aws.amazon.com/s3/


Installing Development Tools (optional)
=======================================

If you plan to work on Review Board's source code, there are a few
additional packages you'll need to install:

* nose_
* Sphinx_

You can install these in one go by typing::

    $ easy_install nose Sphinx


.. _nose: http://somethingaboutorange.com/mrl/projects/nose/
.. _Sphinx: http://sphinx.pocoo.org/



After Installation
==================

Once you've finished getting Review Board itself installed, you'll want to
create your site. See :ref:`creating-sites` for details.


.. comment: vim: ft=rst et
