source: gli/trunk/gli.bat@ 19388

Last change on this file since 19388 was 19388, checked in by ak19, 15 years ago

3 changes. 1. Moved GLI.bat's the finding and setting of GSDLHOME (and GSDL3SRCHOME and GSDL3HOME) into a separate batfile: findgsdl.bat. 2. This bat file is now called by both gli.bat and client-gli.bat, since client-bat can from now on use the same logice to locate a local GS installation. The only difference is that if GSDLHOME is not found, then client-gli runs as before: no Download panel. 3. Client-gli.bat will not look for a gs2build directory located inside a client-gli checkout, but instead search for a local GSDLHOME (including in the directory directly above, in case client-gli.bat is run from a normal GS checkout. IF a GSDLHOME is found (and perl too), then client-gli will enable the Download panel - using the local GSDLHOME to do the downloading.

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