Changeset 17332 for gli


Ignore:
Timestamp:
09/18/08 16:43:50 (12 years ago)
Author:
oranfry
Message:

using search4j to find java in gli.bat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/gli.bat

    r17325 r17332  
    221221       
    222222:testPerl
    223 echo.
    224223:: Check that a Perl executable has been found
    225 if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
    226 if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
    227 if "%GLILANG%" == "fr" echo V‚rification de Perl: %PERLPATH%
    228 if "%GLILANG%" == "ru" echo à®¢¥àª  Perl: %PERLPATH%
    229 if exist "%PERLPATH%\perl.exe" goto findJava
     224if not exist "%PERLPATH%\perl.exe" goto noPerl
     225echo PERL:
     226echo %PERLPATH%
     227echo.
     228
     229goto findJava
    230230
    231231:noPerl
     
    253253
    254254:findJava
    255 :: ---- Check Java exists ----
    256 set JAVAPATH=
    257 
    258 :: Some users may set the above line manually
    259 if not "%JAVAPATH%" == "" goto testJava
    260 
    261     :: If it is set, use the JAVA_HOME environment variable
    262     if not "%JAVA_HOME%" == "" goto javahome
    263 
    264     :: If it is set, use the JRE_HOME environment variable
    265     if not "%JRE_HOME%" == "" goto jrehome
    266 
    267     :: Check if Java is on the search path
    268     echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > %TMP%\setjava.bat
    269     call %TMP%\setjava.bat
    270     del %TMP%\setjava.bat
    271     if not "%JAVAPATH%" == "" goto testJava
    272 
    273     :: Still haven't found anything, so try looking in the registry (gulp!)
    274     type nul > %TMP%\jdk.reg
    275     regedit /E %TMP%\jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
    276     type %TMP%\jdk.reg > %TMP%\jdk.txt
    277     del %TMP%\jdk.reg
    278     type nul > %TMP%\jre.reg
    279     regedit /E %TMP%\jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
    280     type %TMP%\jre.reg > %TMP%\jre.txt
    281     del %TMP%\jre.reg
    282 
    283     winutil\findjava.exe %TMP%\jdk.txt %TMP%\jre.txt | winutil\setvar.exe JAVAPATH > %TMP%\setjava.bat
    284     del %TMP%\jdk.txt
    285     del %TMP%\jre.txt
    286     call %TMP%\setjava.bat
    287     del %TMP%\setjava.bat
    288 
    289     :: If nothing was found in the registry, we're stuck
    290     if "%JAVAPATH%" == "" goto noJava
    291 
    292     set JAVAPATH=%JAVAPATH%\bin
    293     goto testJava
    294 
    295 :javahome
    296     set JAVAPATH=%JAVA_HOME%\bin
    297     goto testJava
    298    
    299 :jrehome
    300     set JAVAPATH=%JRE_HOME%\bin
    301     goto testJava
    302 
    303 :testJava
    304 :: Check that a Java executable has been found
    305 if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
    306 if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
    307 if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
    308 if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
    309 if exist "%JAVAPATH%\java.exe" goto checkJV
    310 
    311 :noJava
    312     echo.
    313     if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
    314     if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
    315     if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
    316 
    317     if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
    318     if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
    319     if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
    320 
    321     if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
    322     if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
    323     if "%GLILANG%" == "fr" echo avant de d‚marrer Greenstone Librarian Interface.
    324 
    325     if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
    326     if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
    327     if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
    328     goto exit
    329 
    330 
    331 :: Check the version of Java is new enough (1.4.0 or higher) to run the GLI
    332 :checkJV
    333 "%JAVAPATH%\java" -classpath . CheckJavaVersion
    334      if ERRORLEVEL 2 goto checkGLI
    335     :: Otherwise, errorlevel was an error value
    336        if "%GLILANG%" == "es" La versión del Ambiente de Ejecución Java (JRE por sus siglas en
    337        if "%GLILANG%" == "es" inglés) que usted tiene instalada es demasiado vieja para ejecutar
    338        if "%GLILANG%" == "es" la Interfaz de la %PROGNAME%. Por favor instale
    339        if "%GLILANG%" == "es" una nueva versión del Ambiente de Ejecución Java (versión 1.4 o
    340        if "%GLILANG%" == "es" posterior) y ejecute nuevamente este guión.
    341 
    342            if "%GLILANG%" == "fr" La version de Java Runtime Environment que vous avez installée est
    343            if "%GLILANG%" == "fr" trop vielle pour faire fonctionner %PROGNAME%.
    344            if "%GLILANG%" == "fr" Veuillez installer une nouvelle version du JRE (version 1.4 ou plus
    345            if "%GLILANG%" == "fr" récente) et redémarrez le script.
    346 
    347            if "%GLILANG%" == "ru" ÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,
    348            if "%GLILANG%" == "ru" ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ %PROGNAME%. ðÏÖÁÌÕÊÓÔÁ,
    349            if "%GLILANG%" == "ru" ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É
    350            if "%GLILANG%" == "ru" ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ
    351 
    352            if "%GLILANG%" == "en" The version of the Java Runtime Environment you have installed is too
    353            if "%GLILANG%" == "en" old to run the %PROGNAME%. Please install a new
    354            if "%GLILANG%" == "en" version of the JRE (version 1.4 or newer) and rerun this script.
    355            goto exit
    356 
     255winutil\search4j.exe -m "1.4.0_00" -h "%GSDLHOME%\packages\jre" | winutil\setvar.exe _JRE_HOME > %TMP%\set__jre_home.bat
     256call "%TMP%\set__jre_home.bat"
     257del "%TMP%\set__jre_home.bat"
     258
     259if "%_JRE_HOME%" == "" goto noJava
     260echo %_JRE_HOME%\bin | winutil\setvar.exe JAVAPATH > %TMP%\set_javapath.bat
     261call "%TMP%\set_javapath.bat"
     262del "%TMP%\set_javapath.bat"
     263echo JRE:
     264echo %_JRE_HOME%
     265echo.
     266
     267goto checkGLI
    357268
    358269:checkGLI
     
    377288:runGLI
    378289:: ---- Finally, run the GLI ----
    379 echo.
    380 if not "%_VERSION%" == "" echo Running on Greenstone version %_VERSION%
    381 if not "%GSDL3SRCHOME%" == "" echo GSDL3SRCHOME is %GSDL3SRCHOME%
    382 if not "%GSDL3HOME%" == "" echo GSDL3HOME is %GSDL3HOME%
    383 if not "%GSDLHOME%" == "" echo GSDLHOME is %GSDLHOME%
    384 echo.
     290if not "%_VERSION%" == "" (
     291    echo Greenstone Major Version:
     292    echo %_VERSION%
     293    echo.
     294)
     295
     296if not "%GSDL3SRCHOME%" == "" (
     297    echo GSDL3SRCHOME:
     298    echo %GSDL3SRCHOME%
     299    echo.
     300)
     301
     302if not "%GSDL3HOME%" == "" (
     303    echo GSDL3HOME:
     304    echo %GSDL3HOME%
     305    echo.
     306)
     307
     308if not "%GSDLHOME%" == "" (
     309    echo GSDLHOME:
     310    echo %GSDLHOME%
     311    echo.
     312)
    385313
    386314if "%GLILANG%" == "en" echo Running the %PROGNAME%...
     
    408336
    409337:webLib
    410     "%JAVAPATH%\java" -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
     338    ::"%JAVAPATH%\java" -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
    411339    if ERRORLEVEL 2 goto webLib
    412340    goto finRun
    413341
    414342:localLib
    415     "%JAVAPATH%\java" -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
     343    ::"%JAVAPATH%\java" -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
    416344    if ERRORLEVEL 2 goto localLib
    417345    goto finRun
Note: See TracChangeset for help on using the changeset viewer.