source: trunk/gsdl3/gs3-setup.bat@ 10952

Last change on this file since 10952 was 10952, checked in by kjdon, 16 years ago

added some stuff onto the CLASSPATH for use with GAI

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1@echo off
2
3if exist gs3-setup.bat goto start
4 echo This script must be run from within the Greenstone 3 home directory
5 goto exit
6
7:start
8:: ---- Set the GSDL3HOME variable to the current directory ----
9cd | winutil\setvar.exe GSDL3SRCHOME > setgsdl3.bat
10call setgsdl3.bat
11del setgsdl3.bat
12echo GSDL3SRCHOME: %GSDL3SRCHOME%
13set GSDL3HOME=%GSDL3SRCHOME%\web
14echo GSDL3HOME: %GSDL3HOME%
15
16:: change if using external tomcat
17set TOMCAT_HOME=%GSDL3SRCHOME%\packages\tomcat
18
19:: ---- Set other important environment variables ----
20set GSDLOS=windows
21set PATH=%PATH%;%GSDL3SRCHOME%\bin;%GSDL3SRCHOME%\bin\script;%GSDL3SRCHOME%\lib\jni;%GSDL3SRCHOME%\packages\mysql\bin
22
23:: ---- Set the CLASSPATH environment variable ----
24set CLASSPATH=%GSDL3HOME%\WEB-INF\classes;%GSDL3SRCHOME\resources\java:%CLASSPATH%
25if exist setcp.bat del setcp.bat
26for %%j in ("%GSDL3HOME%"\WEB-INF\lib\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
27for %%j in ("%GSDL3SRCHOME%"\lib\jni\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
28for %%j in ("%TOMCAT_HOME%"\common\endorsed\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
29for %%j in ("%GSDL3SRCHOME%"\build\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
30
31call setcp.bat
32del setcp.bat
33
34echo CLASSPATH: %CLASSPATH%
35
36::cd %GSDL3HOME%
37
38:findJava
39:: ---- Check Java SDK exists ----
40set JAVAPATH=
41
42:: Some users may set the above line manually
43if not "%JAVAPATH%" == "" goto testJava
44
45 :: If it is set, use the JAVA_HOME environment variable
46 if not "%JAVA_HOME%" == "" goto exit
47
48 :: Look in the registry for Java SDK installations
49 type nul > jdk.reg
50 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
51 type jdk.reg > jdk.txt
52 del jdk.reg
53
54 winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVAPATH > setjava.bat
55 del jdk.txt
56 call setjava.bat
57 del setjava.bat
58
59 :: If a suitable installation was found in the registry, check it
60 if not "%JAVAPATH%" == "" goto testJava
61
62:noJava
63 echo.
64 echo Failed to locate an appropriate version of Java. You must install a
65 echo Java Development Kit (version 1.4 or greater) before running the
66 echo Greenstone 3 Digital Library Software.
67 pause
68 goto exit
69
70:testJava
71set JAVA_HOME=%JAVAPATH%
72
73:exit
Note: See TracBrowser for help on using the repository browser.