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

Last change on this file since 13642 was 13618, checked in by kjdon, 17 years ago

removed a coupld of unnecessary things, fixed a couple of bugs

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