Walkthrough: installing Greenstone 3 from SVN source on Windows

You NEED Visual Studio C++. (We haven't tried it with Microsoft's free Visual Studio Express yet.)

Preparation: what you need
 Make sure you have Java 1.4 or higher. I tried it with Java 1.4.2_08.

Set the environmental variable JAVA_HOME to the full path of the Java installation directory. To set environmental variables on Windows, go to Start > Control Panel. Make sure you are in Classic View, if not, in the left-hand pane, press the Switch to Classic View link.

Now double click on the System icon. Select the Advanced tab, click the Environment Variables button. And create a new (System) variable called JAVA_HOME with the value set to the full path to the Java directory. 

Get Apache Ant, at least version 1.6.2. (I tried it with ant 1.6.5.) ;%ANT_HOME%\bin 
 * Create the ANT_HOME environment variable, and set its value to be the full path to the root directory of your ant installation.
 * Then adjust the existing PATH variable to include the bin directory of ANT_HOME. I.e. append the following to your Windows Path variable:

You need the SVN command-line client, because during the first phase of Greenstone 3 source code compilation (the "ant prepare" step) svn is used to download a great many other files that are necessary for compiling and building Greenstone 3.

For example, I got svn-1.4.6-setup.exe from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91  
 * Get the SVN command-line client release for Windows, from http://subversion.tigris.org/project_packages.html
 * Once you've downloaded this, install it by doubleclicking on it and going through the installation wizard (carefully read the stuff in the wizard). See also the page https://www.projects.dev2dev.bea.com/Subversion%20Clients/CommandLineSVN.html for instructions on how to install and use the SVN command-line client.

Installation instructions
See also:
 * the README.txt file in the top-level of your greenstone3 installation folder.

 Now we can finally download Greenstone 3 source code from its SVN repository: Open a command line prompt. Start > Run. Type: cmd. An msdos prompt will launch. Go (using cd) into the folder wherein you want to download greenstone 3 into. Then type: svn checkout http://svn.greenstone.org/main/trunk/greenstone3 Depending on your Internet connection speed, the above may take a *long* time. 

When it has finished checking out Greenstone 3 code, type the following in the command prompt: ant prepare Troubleshooting: If the build fails in this step due to some directory being "locked" (it failed in my case), then it will give you the line number where it failed. Open build.xml in your greenstone3 installation folder and go to the line. If the section around the looks like this: 929 	  930 	   931 	    932 	       933 	   934 	  Then comment out  to get: 929 	  930 	   931 	    932 	      933 	    934 	  Try the ant command again: ant prepare Depending on your internet speed, the above can also take a very long time (it took me over an hour), as it is further checking out files from Greenstone 3's SVN repository. </li>

Once it has finished, you need to do the special Windows step which involves Visual Studio (see for the old instructions in case they work for you): Just have a look to see where it is on your Visual Studio installation. > cd C:\Program Files\Microsoft Visual Studio\VC98\Bin\ > vcvars32.bat It would now have set up the environment for you to be able to successfully compile greenstone3. Don't close the command prompt, because it's just been set for the next step. </li>
 * Locate your Visual Studio's vcvars32.bat file. It may be located in C:\Program Files\Microsoft Visual Studio\VC98\Bin\
 * Back in the command prompt go the location where your vcvars32.bat file is, and run it. Example:

 In the *same* prompt from which you ran vcvars32.bat, go back into your greenstone3 directory and type: ant install Hopefully, after some time, it will come back saying that your build was successful. </li>

Now you should be able to run the tomcat web server by typing ant start in the cmd prompt. Thereafter, open your web browser at http://localhost:8080/greenstone3/ </li> </ol>

Note 1
You could also try the following (it did not work for me):

Go into your greenstone 3 folder--the one svn downloaded all the source into. I'm calling the full path to this $GSDLHOME. Now that you are in GSDLHOME, open build.properties. Make sure that the compile.windows.c++.setup is set to the full path location of your Visual Studio's "vcvars32.bat" file. For example, the default value given is: compile.windows.c++.setup=C:/Program Files/Microsoft Visual Studio/VC98/Bin/VCVARS32.BAT Go back to the MSDOS prompt, move into your greenstone3 folder and type the following: ant install

Advanced
For information on further configuration of the installation (such as changing the port number or host name of the web server), see Walkthrough:_installing_Greenstone_3_from_SVN_source, the Advanced section of the walkthrough of installing GS3 from SVN for Linux.