source: main/trunk/greenstone3/gs3-server.bat@ 38417

Last change on this file since 38417 was 38417, checked in by anupama, 5 months ago

Dr Bainbridge pointed out that the gs3-server script should source the new SETUP script instead of the gs3-setup script, as SETUP will source cli extensions besides sourcing the gs3-setup script. We also need gs3-server.bat to do the same, for which we need a SETUP.bat first.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1@echo off
2
3echo Greenstone 3 Server
4echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
5echo This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
6echo This is free software, and you are welcome to redistribute it
7
8:: ---- Determine GSDL3HOME ----
9:: Some users may set the above line manually
10set GSDL3PATH=
11
12:: The default location is the current directory
13 if "%GSDL3PATH%" == "" set GSDL3PATH=.
14
15:: Setup Greenstone, unless it has already been done
16::if "%GSDL3SRCHOME%" == "" call "%GSDL3PATH%\gs3-setup.bat" SetEnv > nul
17if "%GSDL3SRCHOME%" == "" call "%GSDL3PATH%\SETUP.bat" SetEnv > nul
18
19set USE_TMPDIR_FOR_TOMCAT=
20for /F "usebackq tokens=1,2 delims==" %%G in ("%GSDL3SRCHOME%\build.properties") do (
21 if "%%G"=="gsdl3home.isreadonly" set USE_TMPDIR_FOR_TOMCAT=%%H
22)
23
24:: If the gsdl3.home readonly property is not already set to true, then
25:: See if Greenstone3 web folder is writable
26if "%USE_TMPDIR_FOR_TOMCAT%" == "false" (
27 echo.
28 echo Checking if the Greenstone3 web directory is writable ...
29 (echo This is a temporary file. It is safe to delete it. > "%GSDL3HOME%\testing.tmp" ) 2>nul
30 if exist "%GSDL3HOME%\testing.tmp" goto isWritable
31)
32
33:: Is read-only
34 set gsdl3_writablehome=%TMP%\greenstone\web
35 set opt_properties="-Dgsdl3home.isreadonly=true" -Dgsdl3.writablehome="%gsdl3_writablehome%"
36 if "%USE_TMPDIR_FOR_TOMCAT%" == "false" echo ... no.
37 echo Setting Greenstone3 web home writable area to be: %gsdl3_writablehome%
38
39 goto runJava
40
41:isWritable
42 del "%GSDL3HOME%\testing.tmp"
43 set opt_properties="-Dgsdl3.writablehome=%GSDL3HOME%"
44 echo ... yes.
45
46:runJava
47
48:: Before running the Java program,
49:: call ant target to initialize the gsdl3-writablehome area (if it doesn't already exist)
50:: ... including the all important global.properties.
51
52cmd /c ant.bat %opt_properties% configure-web
53
54
55set GSDL3PATH=
56set USE_TMPDIR_FOR_TOMCAT=
57
58"%RUNJAVA%" -cp "%CLASSPATH%" %opt_properties% org.greenstone.server.Server3 "%GSDL3SRCHOME%"
Note: See TracBrowser for help on using the repository browser.