Tested on Windows (Vista) 64 bit.
You need:
Apache Ant is included in the following instructions, since it too is needed.
The process is to checkout greenstone3 from SVN, then checkout the appropriate subfolder for your OS and bit architecture from http://svn.greenstone.org/local/greenstone3/ into your greenstone3, and name that subfolder local
. The local
subfolder will also provide you with ant
. Then edit the gs3-setup and gs3-devel scripts in local
to point to wherever you have JAVA, PERL, (ANT) installed (and, on Windows, the location of your Visual Studio's VC directory). Then run the gs3-devel.bat in your toplevel GS3 folder before trying to run any of the ant compilation commands:
svn co https://svn.greenstone.org/main/trunk/greenstone3 gs3-svn cd gs3-svn svn co https://svn.greenstone.org/local/greenstone3/<OS-bitness folder*> local
For the OS-bitness folder, you can at present choose from "darwin-64bit", "linux-32bit", "linux-64bit", "windows-64bit".
Use a text editor to edit local/gs3-setup.bat
and local/gs3-devel.bat
to contain the paths to Java, Perl, Ant, Visual Studio's VC folder on your system. We found that 32 bit MS VS 9.0 and 12.0 works in our case, if we set gs3-devel.bat to point to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC so that the script can then issue call vsvarsall.bat amd64
to get it working for 64 bit machines.
Then you're ready to proceed by running the toplevel gs3-devel.bat:
gs3-devel.bat ant ant prepare
(The gs3-devel.bat will print a file not found error on Windows, since gs3-devel.bat runs gs3-setup.bat which refers to some files that the ant prepare step has yet to checkout.)
Once the ant prepare
step has finished:
[ If you're using Visual Studio 14 (a.k.a. Visual Studio 2015; seems to also work with VS15/VS2017), then before proceeding, backup your windows iconv.zip and rename iconv-winVS14-VS2015-plus.zip as the new iconv.zip, as below. (For details on which libiconv this uses and how it was modified to get it to work with VS14, refer to this.)
pushd gs2build\common-src\indexers\packages\windows\iconv move iconv.zip iconv_preVS14.zip move iconv-winVS14-VS2015-plus.zip iconv.zip rmdir /s /q iconv popd
]
Open a new terminal, go back to into the SVN Greenstone 3 checkout directory and run the devel script again before running the actual compile command:
gs3-devel.bat ant install
Note: after compiling with the above steps, your terminal would be left in a state where running GLI would not be able to locate the Greenstone building scripts like import.pl
. Therefore, when compilation is finished, open a fresh DOS prompt to run GLI from.
On 64 bit windows, earlier versions of GS2 on SVN used to have an issue with race conditions (random failing due to asynchronous behaviour) when compiling up apache-httpd as part of GS2. Refer to Compiling the apache-httpd included with GS2 on 64 bit Windows 7. The following instructions were found to generally work with these older versions, but sometimes required recompiling when the first attempt failed.
Fixes to avoid the race conditions were made by introducing 2 scripts adjust-winmak-files.bat and mod_winmak_file.awk after which the following instructions worked all the time.
You need:
svn co http://svn.greenstone.org/main/trunk/greenstone2 gs2-svn
cd gs2-svn pushd common-src\indexers\packages\windows\iconv move iconv.zip iconv_preVS14.zip move iconv-winVS14-VS2015-plus.zip iconv.zip rmdir /s /q iconv popd
local
. If you're on Windows 64 bit, then you'd do:svn co http://svn.greenstone.org/local/greenstone2/windows-64bit local
local/setup.bat
to set the environment variables to where you have got the following installed on your system: SVN, Java SDK 7+, the Greenstone customised Strawberry Perl (download it from here), Visual Studio 9+ (Microsoft SDK is no longer needed even when the debug flag is turned on).local/setup32.bat
script to local/setup.bat
, then edit it to set the environment variables according to your system.setup.bat
, which will automatically run local/setup.bat
too:cd <your GS2 svn checked out folder> setup.bat
makegs2x64.bat
Type "Y" to Extract All, then when the DOS prompt display asks what you want to compile up, type "4" to compile all without debugging, or type "5" to compile everything with debugging on. (Type "6" to clean compiled files before recompilation if you want to recompile from scratch).
Note:
In GS2 SVN checkouts from before changeset 31428, compilation on 64 bit Windows could still fail with error messages as described here, which indicates that the race condition has struck. In that case, try deleting the apache-httpd\windows\error
folder if it has been generated, or all of the apache-httpd
folder and run makegs2x64.bat
again, choosing the same options as before. If the 'error' folder or apache-httpd
folder did not exist and therefore can't be deleted, then just re-run makegs2x64.bat again. If that fails, run makegs2x64.bat
and select the clean
command (option 6) and then re-run makegs2x64.bat
to re-compile from scratch. If doing so in a fresh command prompt, remember to run the devel64-in32mode.bat
setup.bat
script in local
before running makegs2x64.bat
.
svn co https://svn.greenstone.org/main/trunk/gli cd gli makegli.bat makejar.bat
You NEED Visual Studio C++. (We haven't tried it with Microsoft's free Visual Studio Express yet.)
=====Preparation: what you need=====
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.
;%ANT_HOME%\bin
For example, I got svn-1.4.6-setup.exe from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
=====Installation instructions===== See also:
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.
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 <target name="prepare-core" unless="nosvn.mode"> 930 <!-- just get rid of empty directories--> 931 <svn> 932 <update dir="."/> 933 </svn> 934 </target>
Then comment out <update dir="."/> to get:
929 <target name="prepare-core" unless="nosvn.mode"> 930 <!-- just get rid of empty directories--> 931 <svn> 932 <!-- <update dir="."/> --> 933 </svn> 934 </target>
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.
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.
ant install
Hopefully, after some time, it will come back saying that your build was successful.
ant start
in the cmd prompt. Thereafter, open your web browser at http://localhost:8080/greenstone3/
===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 Advanced, the Advanced section of the walkthrough of installing GS3 from SVN for Linux.
You will need:
===== Where to get the source code ===== You can get the source code from SVN (as described below) or alternatively, you can either get the source distribution or, during the installation of the binary distribution, choose to include the source code (for these see source install.
For example, I got svn-1.4.6-setup.exe from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
svn co http://svn.greenstone.org/main/trunk/greenstone2 greenstone2
which will checkout Greenstone 2 source code into a new folder called "greenstone2".
===== Getting windows binaries ===== This is required to get the conversion tools used for importing different types of files, such as wvware.
For example:
cd C:\greenstone2\bin
svn co http://svn.greenstone.org/main/trunk/binaries/windows/bin windows
===== Compiling Greenstone 2 source code on Windows ===== Follow the instructions at Compiling Greenstone, the Windows section. ===== Getting the Greenstone Librarian Interface (GLI) =====
svn co http://svn.greenstone.org/main/trunk/gli gli
cd gli makegli.bat
cd .. setup.bat
Still in the top-level Greenstone 2 folder, make a copy of the file glisite.cfg and name it gsdlsite.cfg. Then open up the original (glisite.cfg) and change the following two lines to become:
autoenter=1 start_browser=0
cd gli gli.bat
You will need:
===== Where to get the source code ===== You can get the source code from SVN (as described below) or alternatively, you can either get the source distribution or, during the installation of the binary distribution, choose to include the source code (for these see source install.
For example, I got svn-1.4.6-setup.exe from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
svn co http://svn.greenstone.org/main/trunk/greenstone2 greenstone2
which will checkout Greenstone 2 source code into a new folder called "greenstone2".
===== Getting windows binaries ===== This is required to get the conversion tools used for importing different types of files, such as wvware.
For example:
cd C:\greenstone2\bin
svn co http://svn.greenstone.org/main/trunk/binaries/windows/bin windows
===== Compiling Greenstone 2 source code on Windows ===== Follow the instructions at Compiling Greenstone, the Windows section. ===== Getting the Greenstone Librarian Interface (GLI) =====
svn co http://svn.greenstone.org/main/trunk/gli gli
cd gli makegli.bat
cd .. setup.bat
Still in the top-level Greenstone 2 folder, make a copy of the file glisite.cfg and name it gsdlsite.cfg. Then open up the original (glisite.cfg) and change the following two lines to become:
autoenter=1 start_browser=0
cd gli gli.bat