2.8. Windows

GNUMed requires the following packages. Each link points to a .EXE file. Download them and run each in turn.

Table 2-3. Requirements

PackageURLVersion
Python Scripting Languagepython.org2.1
wxWindows windowing librarywxWindows for Python bindings2.3.2
mx extension librariesmx2.0.3
PyGresQL -- Python libraries for SQLPyGresQL2.2
CYGWIN UNIX emulatorcygwin.com2.1
IPC for CygwinCygIPC (this is not an .EXE file. Save it to C:\CYGWIN)1.11

Download these packages. For cygwin, make sure you select the package PostgreSQL in the Databases category.

2.8.1. Installing PostgreSQL

Double-click on the Cygwin icon on your desktop. The UNIX command prompt appears. Take a deep breath, and type:
cd /
tar xvjf /cygipc-1.11-1.bz2
/usr/local/bin/ipc-daemon &
mkdir /usr/share/postgresql/data
/usr/bin/initdb -D /
/usr/bin/postmaster -D /usr/share/postgresql/data &
Postgres should now be running. DO NOT close the window containing these commands.

Every time to want to run PostgreSQL again, open up Cygwin as before and type:
/usr/local/bin/ipc-daemon &
/usr/bin/postmaster -D /usr/share/postgresql/data &

Once PostgreSQL is set up, go to the section on setting up the database (SQL Setup.)

2.8.1.1. Running PostgreSQL as an NT service

On Windows NT, 2000 or XP it is possible to run PostgreSQL as a background process (similar to a UNIX daemon).

Go to Control Panel: "Users", and create a new user for your system, called "postgres". Give the user privileges to run as a service.

At the Cygwin prompt, type:
ipc-daemon --install-as-service
Then,as a single line:
cygrunsrv --install postmaster --path /usr/bin/postmaster --args "-D
  /usr/share/postgresql/data -i" --dep ipc-daemon --termsig INT --user
  postgres --shutdown
Then
mkdir /usr/share/postgresql/data
chown postgres /usr/share/postgresql/data
If this directory (/usr/share/postgresql/data) already exists from your previous efforts, delete it with "rm -R /usr/share/postgresql/data", and repeat.

Reboot the computer. Now log in as the "postgres" user, load Cygwin again and type:
initdb -D /usr/share/postgresql/data
The database will now run whenever Windows is loaded. You must be user "postgres" to use the database on this computer.

Once PostgreSQL is set up, go to the section on setting up the database (SQL Setup.)