root/gli/trunk/client-gli.bat @ 19388

Revision 19388, 4.8 KB (checked in by ak19, 11 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
Line 
1@echo off
2pushd "%CD%"
3CD /D "%~dp0"
4set GLILANG=en
5set GLIMODE=client
6
7if "%PROGNAME%" == "" set PROGNAME=Greenstone
8
9if not "%PROGFULLNAME%" == "" goto setvars
10if "%GLILANG%" == "es" set PROGFULLNAME="Biblioteca Digital Greenstone" 
11if "%GLILANG%" == "fr" set PROGFULLNAME="Bibliothécaire Greenstone"
12if "%GLILANG%" == "ru" set PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
13:: if the PROGFULLNAME is still not set, then set the language to English
14if "%PROGFULLNAME%" == "" set PROGNAME=Greenstone Digital Library
15 
16
17:setvars
18if "%PROGABBR%" == "" set PROGABBR=GLI
19if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
20
21::  -------- Run the Greenstone Librarian Interface --------
22
23:: This script must be run from within the directory in which it lives
24if exist client-gli.bat goto start
25    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
26    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
27    if "%GLILANG%" == "fr" echo Ce script doit ˆtre ex‚cut‚ … partir du r‚pertoire dans lequel il se trouve.
28    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
29    goto exit
30
31:start
32if "%OS%" == "Windows_NT" goto findGSDL
33    :: Invoke a new command processor to ensure there's enough environment space
34    if "%1" == "Second" goto findGSDL
35        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
36        goto done
37
38:findGSDL
39:: Try to detect a local GSDLHOME installation (gs2build). If none can be
40:: found, then client-gli won't have a download panel. We're calling
41:: findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and
42:: use that for downloading. If there IS a local GSDLHOME, then we can download
43:: (and build) locally, but ONLY if we have perl. Else downloading and building
44:: will have to be done remotely anyway. If Perl is found, PERLPATH will be set.
45call findgsdl.bat
46if "%GSDLHOME%" == "" goto findJava
47    call findperl.bat
48
49:findJava
50:: Need to find Java. If found, JAVA_EXECUTABLE will be set
51call findjava.bat
52if "%JAVA_EXECUTABLE%" == "" goto exit
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 %PROGNAME_EN% (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 %PROGFULLNAME%
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 %PROGNAME% Interface (en utilisant makegil.bat)
66    if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
67
68    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥à䥩á %PROGNAME% (šá¯®«ì§ãï makegli.bat)
69    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
70    goto exit
71
72
73:runGLI
74:: ---- Finally, run the GLI ----
75echo.
76
77
78if "%GLILANG%" == "en" echo Running the %PROGNAME_EN%...
79if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la %PROGFULLNAME%...
80if "%GLILANG%" == "fr" echo Ex‚cution de %PROGNAME_EN%
81if "%GLILANG%" == "ru" echo ’¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥à䥩á %PROGNAME%...
82
83:: -Xms32M          To set minimum memory
84:: -Xmx32M          To set maximum memory
85:: -verbose:gc      To set garbage collection messages
86:: -Xincgc          For incremental garbage collection
87:: -Xprof           Function call profiling
88:: -Xloggc:<file>   Write garbage collection log
89
90
91:: If there a local GS2 installation (GSDLHOME set), we'd have looked for Perl. If we had
92:: found Perl, PERLPATH would have been set. If no perl, can't download or build locally on
93:: the client side. If we have Perl, pass the gs2build dir with the -gsdl flag and the PERLPATH.
94if "%PERLPATH%" == "" goto nogsdl
95    echo Perl and GSDLHOME (%GSDLHOME%) detected. Downloading is enabled.
96    echo.
97    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "%GSDLHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
98    goto finish
99
100:nogsdl
101echo Since there's no GSDLHOME, client-GLI's download panel will be deactivated.
102"%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9
103
104:finish
105if "%GLILANG%" == "en" echo Done!
106if "%GLILANG%" == "es" echo ­Hecho!
107if "%GLILANG%" == "fr" echo Termin‚!
108if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
109goto done
110
111:exit
112echo.
113pause
114
115:done
116:: ---- Clean up ----
117set PERLPATH=
118set JAVA_EXECUTABLE=
119set GLIMODE=
120set PROGNAME=
121set PROGNAME_EN=
122set PROGFULLNAME=
123set PROGABBR=
124popd
Note: See TracBrowser for help on using the browser.