root/gli/trunk/gli.bat @ 19390

Revision 19390, 6.0 KB (checked in by ak19, 10 years ago)

Putting paths in execution line into quotes.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1@echo off
2color 0A
3pushd "%CD%"
4CD /D "%~dp0"
5set GLILANG=en
6
7if "%GLIMODE%" == "" set GLIMODE=local
8
9::  -------- Run the Greenstone Librarian Interface --------
10
11:: This script must be run from within the directory in which it lives
12if exist gli.bat goto start
13    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
14    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
15    if "%GLILANG%" == "fr" echo Ce script doit ˆtre ex‚cut‚ … partir du r‚pertoire dans lequel il se trouve.
16    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
17    goto exit
18
19:start
20if "%OS%" == "Windows_NT" goto progName
21    :: Invoke a new command processor to ensure there's enough environment space
22    if "%1" == "Second" goto progName
23        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
24        goto done
25
26
27:progName
28if not "%PROGNAME%" == "" goto findGSDL
29    :: otherwise PROGNAME was not set, so default to the Greenstone Librarian Interface (GLI) program
30    if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Greenstone
31    if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Greenstone
32    if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Greenstone
33    :: if the PROGNAME is still not set, then set the language to English
34    if "%PROGNAME%" == "" set PROGNAME=Greenstone Librarian Interface
35
36
37if "%PROGABBR%" == "" set PROGABBR=GLI
38if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
39
40:: Now need to work out the _VERSION, GSDLHOME (and if GS3, then GSDL3SRCHOME and GSDL3HOME)
41:findGSDL
42call findgsdl.bat
43if "%GSDLHOME%" == "" goto exit
44
45:: Now need to find Perl. If found, PERLPATH will be set
46call findperl.bat
47if "%PERLPATH%" == "" goto exit
48
49:: Need to find Java. If found, JAVA_EXECUTABLE will be set
50call findjava.bat
51if "%JAVA_EXECUTABLE%" == "" goto exit
52
53
54:checkGLI
55:: ---- Check that the GLI has been compiled ----
56if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
57if exist "GLI.jar" goto runGLI
58    echo.
59    if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
60    if "%GLILANG%" == "en" echo before running this script.
61
62    if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
63    if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
64
65    if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegli.bat)
66    if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
67
68    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone (šá¯®«ì§ãï makegli.bat)
69    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
70    goto exit
71
72
73:runGLI
74
75if not "%_VERSION%" == "" (
76    echo Greenstone Major Version:
77    echo %_VERSION%
78    echo.
79)
80
81if not "%GSDL3SRCHOME%" == "" (
82    echo GSDL3SRCHOME:
83    echo %GSDL3SRCHOME%
84    echo.
85)
86
87if not "%GSDL3HOME%" == "" (
88    echo GSDL3HOME:
89    echo %GSDL3HOME%
90    echo.
91)
92
93if not "%GSDLHOME%" == "" (
94    echo GSDLHOME:
95    echo %GSDLHOME%
96    echo.
97)
98
99:: ---- Explain how to bypass Imagemagick and Ghostscript bundled with Greenstone if needed ----
100echo.
101if exist "%GSDLHOME%\bin\windows\ghostscript\bin\*.*" echo GhostScript bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to %GSDLHOME%\bin\windows and rename the folder called ghostscript to something else.
102echo.
103echo.
104if exist "%GSDLHOME%\bin\windows\imagemagick\*.*" echo ImageMagick bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to %GSDLHOME%\bin\windows and rename the folder called imagemagick to something else.
105echo.
106echo.
107
108
109:: ---- Finally, run the GLI ----
110if "%GLILANG%" == "en" echo Running the %PROGNAME%...
111if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
112if "%GLILANG%" == "fr" echo Ex‚cution de %PROGNAME%
113if "%GLILANG%" == "ru" echo ’¥ªãéš© ¡š¡«š %PROGNAME%...
114
115:: -Xms32M          To set minimum memory
116:: -Xmx32M          To set maximum memory
117:: -verbose:gc      To set garbage collection messages
118:: -Xincgc          For incremental garbage collection
119:: -Xprof           Function call profiling
120:: -Xloggc:<file>   Write garbage collection log
121
122
123:: Run GS3 if version = 3
124if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -gsdl3 "%GSDL3HOME%" -gsdl3src "%GSDL3SRCHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
125if "%_VERSION%" == "3" goto finRun
126
127:: Run GS2 since version is 2:
128:: if FLI is running, we don't want the local Greenstone library server running
129if "%PROGABBR%" == "FLI" goto webLib
130    :: Else we're running GLI, so we want the local Greenstone library server (if server.exe exists, otherwise it will be webLib)
131    if exist "%GSDLHOME%\server.exe" goto localLib
132
133:webLib
134    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
135    if ERRORLEVEL 2 (
136        goto webLib
137    )
138    goto finRun
139
140:localLib
141    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" -local_library "%GSDLHOME%\server.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
142    if ERRORLEVEL 2 (
143        goto localLib
144    )
145    goto finRun
146
147
148:finRun
149    if "%GLILANG%" == "en" echo Done!
150    if "%GLILANG%" == "es" echo ­Hecho!
151    if "%GLILANG%" == "fr" echo Termin‚!
152    if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
153    goto done
154
155
156:exit
157echo.
158pause
159color 07
160popd
161
162:done
163:: ---- Clean up ----
164set PERLPATH=
165set JAVA_EXECUTABLE=
166set GLIMODE=
167set PROGNAME=
168set PROGNAME_EN=
169set PROGFULLNAME=
170set PROGABBR=
171color 07
172popd
Note: See TracBrowser for help on using the browser.