Ignore:
Timestamp:
2009-05-08T12:42:48+12:00 (15 years ago)
Author:
ak19
Message:

Updated client-gli.bat and findjava.bat. Now client-gli uses the same logic to find Java as gli.bat. Previously client-gli would resort to looking in the registry since there was no search4j in GLI. Now there is, and only svn versions of gli-only checkouts won't have a search4j (compiled up). findjava.bat now looks for search4j to get Java, otherwise it looks for JAVA_HOME to be set--to any Java--and uses that after printing a warning message to the user. Finally, if there is neither a search4j nor any JAVA_HOME set, then it exits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/findjava.bat

    r19336 r19353  
    11@echo off
    22
    3 :: Environment Variables passed in: _VERSION and GLILANG
     3:: Environment Variables passed in: _VERSION, GLILANG and
     4:: possibly also GSDLHOME and/or GSDL3SRCHOME.
    45:: As a result of executing this script, the JAVA_EXECUTABLE variable
    56:: will be set, but only if Perl was found.
    67
     8:findJava
    79
    8 :findJava
    9     if "%_VERSION%" == "2" (
     10:: We will already be in the correct folder (GLI folder), which would
     11:: contain a compiled up search4j.exe if this GLI is part of an installation.
     12:: If search4j.exe is not there, then it means this is an SVN checkout.
     13:: In such a case, it's up to the user checking things out to ensure JAVA_HOME
     14:: is set and moreover points to the correct version of the Java.
     15
     16set DISPLAY_MIN_VERSION=1.4
     17set MIN_VERSION=1.4.0_00
     18set SEARCH4J_EXECUTABLE=search4j.exe
     19if exist %SEARCH4J_EXECUTABLE% goto setJexec
     20if "%_VERSION%" == "" goto tryJava
     21    :: else we look for a compiled version of search4j in a GS installation
     22    if "%_VERSION%" == "2" (
    1023        set SEARCH4J_EXECUTABLE=%GSDLHOME%\bin\windows\search4j.exe
    1124        set HINT=%GSDLHOME%\packages\jre
    1225    )
    13     if "%_VERSION%" == "3" (
     26        if "%_VERSION%" == "3" (
    1427        set SEARCH4J_EXECUTABLE=%GSDL3SRCHOME%\bin\search4j.exe
    1528        set HINT=%GSDL3SRCHOME%\packages\jre
    1629    )
    17    
    18     "%SEARCH4J_EXECUTABLE%" -e -m "1.4.0_00" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat
     30    if not exist "%SEARCH4J_EXECUTABLE%" goto tryJava
     31
     32:setJexec   
     33    "%SEARCH4J_EXECUTABLE%" -e -m "%MIN_VERSION%" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat
    1934    call "%TMP%\set_java_executable.bat"
    2035    del "%TMP%\set_java_executable.bat"
     
    2843    goto exit
    2944
     45:tryJava
     46if "%JAVA_HOME%" == "" goto noJava
     47if not exist "%JAVA_HOME%\bin\java.exe" goto noJava
     48    if "%GLILANG%" == "en" (
     49        echo.
     50        echo ***************************************************************************
     51            echo WARNING:
     52        echo Found a JAVA_HOME at %JAVA_HOME%. Attempting to use this.
     53        echo However, you need to have a Java %DISPLAY_MIN_VERSION% or higher installed.
     54        echo ***************************************************************************
     55        echo.
     56    )
     57    :: Try to use this version
     58    set JAVA_EXECUTABLE=%JAVA_HOME%\bin\java
     59    goto exit
     60
    3061:noJava
    3162    echo.
    3263    if "%GLILANG%" == "en" (
    3364        echo Failed to locate an appropriate version of Java. You must install a
    34             echo Java Runtime Environment ^(version 1.4 or greater^) before running the
     65            echo Java Runtime Environment ^(version %DISPLAY_MIN_VERSION% or greater^) before running the
    3566            echo Greenstone Librarian Interface.
    3667    )
     
    3869    if "%GLILANG%" == "es" (
    3970        echo No se pudo localizar una versi¢n apropiada de Java. Usted deber
    40             echo instalar un Ambiente de Ejecuci¢n Java ^(versi¢n 1.4 o superior^)
     71            echo instalar un Ambiente de Ejecuci¢n Java ^(versi¢n %DISPLAY_MIN_VERSION% o superior^)
    4172            echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
    4273    )
     
    4475    if "%GLILANG%" == "fr" (
    4576        echo Une version ad?quate de Java n'a pas pu ?tre localis?e. Vous devez
    46             echo installer un Java Runtime Environment ^(version 1.4 ou sup?rieur^)
     77            echo installer un Java Runtime Environment ^(version %DISPLAY_MIN_VERSION% ou sup?rieur^)
    4778            echo avant de d?marrer Greenstone Librarian Interface.
    4879    )
     
    5081    if "%GLILANG%" == "ru" (
    5182        echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ 宊€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àᚚ Java.
    52             echo ?ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment ^(¢¥àášî 1.4 š«š ¢ëè¥^) ¯¥à¥€ ¢¢®€®¬
     83            echo ?ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment ^(¢¥àášî %DISPLAY_MIN_VERSION% š«š ¢ëè¥^) ¯¥à¥€ ¢¢®€®¬
    5384            echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
    5485    )
     
    5788:exit
    5889set SEARCH4J_EXECUTABLE=
     90set MIN_VERSION=
     91set DISPLAY_MIN_VERSION=
Note: See TracChangeset for help on using the changeset viewer.