source: main/trunk/gli/client-gli.bat@ 38935

Last change on this file since 38935 was 34258, checked in by ak19, 4 years ago

Added code to allow running standalone client-gli with a packages\windows\jre subfolder and bin\search4j folder. However as a jre is some 110MB, may decide not to distribute a standalone client-gli distribution with a jre, let alone a jre for each OS.

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