root/greenstone3/trunk/gs3-setup.bat @ 20212

Revision 20212, 2.0 KB (checked in by oranfry, 11 years ago)

windows equivalent to last change

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1@echo off
2
3set java_min_version=1.5.0_00
4
5if exist gs3-setup.bat goto start
6  echo This script must be run from within the Greenstone 3 home directory
7  goto exit
8
9:start
10:: ---- Set some relevant environment variables ----
11
12:: this is the default
13:: greenstone3 (%GSDL3SRCHOME%)
14:: +-- web (%GSDL3HOME%)
15:: +-- packages
16::      +-- tomcat (%TOMCAT_HOME%)
17::      +-- ant (%ANT_HOME%)
18
19:: set GSDLSRCHOME to the current directory
20cd | winutil\setvar.exe GSDL3SRCHOME > %TMP%\setgsdl3.bat
21call %TMP%\setgsdl3.bat
22del %TMP%\setgsdl3.bat
23
24:: set GSDLHOME to the 'web' subdirectory
25set GSDL3HOME=%GSDL3SRCHOME%\web
26
27:: change if using external tomcat or ant
28set TOMCAT_HOME=%GSDL3SRCHOME%\packages\tomcat
29set ANT_HOME=%GSDL3SRCHOME%\packages\ant
30
31:: other important environment variables
32set GSDLOS=windows
33
34:: ---- Set the CLASSPATH and PATH environment variables ----
35if "%GS_CP_SET%" == "yes" goto skipSetCp
36set CLASSPATH=%GSDL3HOME%\WEB-INF\classes;%GSDL3SRCHOME%\resources\java;%GSDL3SRCHOME%\cp.jar;%CLASSPATH%;
37set PATH=%PATH%;%GSDL3SRCHOME%\bin;%GSDL3SRCHOME%\bin\script;%GSDL3SRCHOME%\lib\jni;%ANT_HOME%\bin
38
39:: a little dynamic set cp stuff
40if exist %TMP%\setcp.bat del %TMP%\setcp.bat
41for %%j in ("%TOMCAT_HOME%"\common\endorsed\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %TMP%\setcp.bat
42for %%j in ("%TOMCAT_HOME%"\lib\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %TMP%\setcp.bat
43if exist %TMP%\setcp.bat call %TMP%\setcp.bat
44if exist %TMP%\setcp.bat del %TMP%\setcp.bat
45
46set GS_CP_SET=yes
47:skipSetCp
48
49:: ---- Search for java ----
50bin\search4j.exe -p "%CD%\packages\jre" -m %java_min_version% | winutil\setvar.exe _JRE_HOME > %TMP%\set_jre_home.bat
51call %TMP%\set_jre_home.bat
52del %TMP%\set_jre_home.bat
53
54echo %_JRE_HOME%\bin\java.exe | winutil\setvar.exe RUNJAVA > %TMP%\setrunjava.bat
55call %TMP%\setrunjava.bat
56del %TMP%\setrunjava.bat
57
58if "%JRE_HOME%" == "" set JRE_HOME=%_JRE_HOME%
59
60echo GSDL3SRCHOME : %GSDL3SRCHOME%
61echo GSDL3HOME    : %GSDL3HOME%
62echo JAVA         : %RUNJAVA%
Note: See TracBrowser for help on using the browser.