[15070] | 1 | @echo off
|
---|
| 2 |
|
---|
| 3 | echo Greenstone 3 Server
|
---|
| 4 | echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
|
---|
| 5 | echo This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
|
---|
| 6 | echo This is free software, and you are welcome to redistribute it
|
---|
| 7 |
|
---|
| 8 | :: ---- Determine GSDL3HOME ----
|
---|
| 9 | :: Some users may set the above line manually
|
---|
| 10 | set 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
|
---|
| 17 |
|
---|
[30568] | 18 | set USE_TMPDIR_FOR_TOMCAT=
|
---|
[30592] | 19 | for /F "usebackq tokens=1,2 delims==" %%G in ("%GSDL3SRCHOME%\build.properties") do (
|
---|
[30568] | 20 | if "%%G"=="gsdl3home.isreadonly" set USE_TMPDIR_FOR_TOMCAT=%%H
|
---|
| 21 | )
|
---|
[27833] | 22 |
|
---|
[30568] | 23 | :: If the gsdl3.home readonly property is not already set to true, then
|
---|
[27833] | 24 | :: See if Greenstone3 web folder is writable
|
---|
[30568] | 25 | if "%USE_TMPDIR_FOR_TOMCAT%" == "false" (
|
---|
[27833] | 26 | echo.
|
---|
| 27 | echo Checking if the Greenstone3 web directory is writable ...
|
---|
[27839] | 28 | (echo This is a temporary file. It is safe to delete it. > "%GSDL3HOME%\testing.tmp" ) 2>nul
|
---|
| 29 | if exist "%GSDL3HOME%\testing.tmp" goto isWritable
|
---|
[30568] | 30 | )
|
---|
[27833] | 31 |
|
---|
| 32 | :: Is read-only
|
---|
| 33 | set gsdl3_writablehome=%TMP%\greenstone\web
|
---|
[27903] | 34 | set opt_properties="-Dgsdl3home.isreadonly=true" -Dgsdl3.writablehome="%gsdl3_writablehome%"
|
---|
[30568] | 35 | if "%USE_TMPDIR_FOR_TOMCAT%" == "false" echo ... no.
|
---|
[27833] | 36 | echo Setting Greenstone3 web home writable area to be: %gsdl3_writablehome%
|
---|
[27864] | 37 |
|
---|
[27833] | 38 | goto runJava
|
---|
| 39 |
|
---|
| 40 | :isWritable
|
---|
[27839] | 41 | del "%GSDL3HOME%\testing.tmp"
|
---|
[27903] | 42 | set opt_properties="-Dgsdl3.writablehome=%GSDL3HOME%"
|
---|
[27833] | 43 | echo ... yes.
|
---|
| 44 |
|
---|
| 45 | :runJava
|
---|
| 46 |
|
---|
[27873] | 47 | :: Before running the Java program,
|
---|
| 48 | :: call ant target to initialize the gsdl3-writablehome area (if it doesn't already exist)
|
---|
| 49 | :: ... including the all important global.properties.
|
---|
| 50 |
|
---|
[27877] | 51 | cmd /c ant.bat %opt_properties% configure-web
|
---|
[27873] | 52 |
|
---|
| 53 |
|
---|
[15070] | 54 | set GSDL3PATH=
|
---|
[30574] | 55 | set USE_TMPDIR_FOR_TOMCAT=
|
---|
[15070] | 56 |
|
---|
[27833] | 57 | "%RUNJAVA%" -cp "%CLASSPATH%" %opt_properties% org.greenstone.server.Server3 "%GSDL3SRCHOME%"
|
---|
[15070] | 58 |
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 |
|
---|
[13235] | 62 | |
---|