source: branches/ant-install-branch/gsdl3/gs3-setup.bat@ 9822

Last change on this file since 9822 was 8067, checked in by mdewsnip, 20 years ago

Removed GSDLHOME stuff (it is now done only when necessary -- in the gli4gs3 scripts).

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 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 GSDL3HOME > setgsdl3.bat
10call setgsdl3.bat
11del setgsdl3.bat
12echo GSDL3HOME: %GSDL3HOME%
13
14:: ---- Set other important environment variables ----
15set GSDLOS=windows
16set PATH=%PATH%;%GSDL3HOME%\bin;%GSDL3HOME%\bin\script;%GSDL3HOME%\lib;%GSDL3HOME%\packages\mysql\bin
17
18:: ---- Set the CLASSPATH environment variable ----
19set CLASSPATH=%GSDL3HOME%\resources\java;%GSDL3HOME%\resources\dtd;%GSDL3HOME%\src\java;%GSDL3HOME%\comms\jakarta\tomcat\common\lib\servlet.jar;%GSDL3HOME%\lib\java
20cd %GSDL3HOME%\lib\java
21if exist setcp.bat del setcp.bat
22for %%j in (*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%GSDL3HOME%\lib\java\%%j>> setcp.bat
23call setcp.bat
24del setcp.bat
25echo CLASSPATH: %CLASSPATH%
26
27cd %GSDL3HOME%
28
29:findJava
30:: ---- Check Java SDK exists ----
31set JAVAPATH=
32
33:: Some users may set the above line manually
34if not "%JAVAPATH%" == "" goto testJava
35
36 :: If it is set, use the JAVA_HOME environment variable
37 if not "%JAVA_HOME%" == "" goto exit
38
39 :: Look in the registry for Java SDK installations
40 type nul > jdk.reg
41 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
42 type jdk.reg > jdk.txt
43 del jdk.reg
44
45 winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVAPATH > setjava.bat
46 del jdk.txt
47 call setjava.bat
48 del setjava.bat
49
50 :: If a suitable installation was found in the registry, check it
51 if not "%JAVAPATH%" == "" goto testJava
52
53:noJava
54 echo.
55 echo Failed to locate an appropriate version of Java. You must install a
56 echo Java Development Kit (version 1.4 or greater) before running the
57 echo Greenstone 3 Digital Library Software.
58 pause
59 goto exit
60
61:testJava
62set JAVA_HOME=%JAVAPATH%
63
64:exit
Note: See TracBrowser for help on using the repository browser.