1 | @echo off
|
---|
2 |
|
---|
3 | :: Environment Variables passed in: GSLDHOME, OS, GLILANG
|
---|
4 | :: As a result of executing this script, the PERLPATH variable
|
---|
5 | :: will be set, but only if Perl was found.
|
---|
6 |
|
---|
7 | :findPerl
|
---|
8 | :: ---- Check Perl exists ----
|
---|
9 | set PERLPATH=
|
---|
10 |
|
---|
11 | :: Some users may set the above line manually - If you do this, you need to
|
---|
12 | :: make sure that perl is in your path otherwise lucene collections may not
|
---|
13 | :: work
|
---|
14 | if not "%PERLPATH%" == "" goto testPerl
|
---|
15 | :: Check if Perl is on the search path
|
---|
16 | echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
|
---|
17 | call %TMP%\setperl.bat
|
---|
18 | del %TMP%\setperl.bat
|
---|
19 | if not "%PERLPATH%" == "" goto testPerl
|
---|
20 |
|
---|
21 | :: If not, try GSDLHOME\bin\windows\perl\bin
|
---|
22 | if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
|
---|
23 |
|
---|
24 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
25 | type nul > %TMP%\perl.reg
|
---|
26 | regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
|
---|
27 | type %TMP%\perl.reg > %TMP%\perl.txt
|
---|
28 | del %TMP%\perl.reg
|
---|
29 |
|
---|
30 | winutil\findperl.exe %TMP%\perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
|
---|
31 | del %TMP%\perl.txt
|
---|
32 | call %TMP%\setperl.bat
|
---|
33 | del %TMP%\setperl.bat
|
---|
34 |
|
---|
35 | :: If nothing was found in the registry, we're stuck
|
---|
36 | if "%PERLPATH%" == "" goto noPerl
|
---|
37 |
|
---|
38 | :: if have found perl in registry, but not in path, then we need to
|
---|
39 | :: add it to path for lucene stuff.
|
---|
40 | if "%OS%" == "Windows_NT" set PATH=%PATH%;%PERLPATH%
|
---|
41 | if "%OS%" == "" set PATH="%PATH%";"%PERLPATH%"
|
---|
42 | goto testPerl
|
---|
43 |
|
---|
44 | :gsdlPerl
|
---|
45 | set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
|
---|
46 |
|
---|
47 | :testPerl
|
---|
48 | :: Check that a Perl executable has been found
|
---|
49 | if not exist "%PERLPATH%\perl.exe" goto noPerl
|
---|
50 | echo Perl:
|
---|
51 | echo %PERLPATH%
|
---|
52 | echo.
|
---|
53 |
|
---|
54 | :: found perl, perlpath set, can exit this script
|
---|
55 | goto exit
|
---|
56 |
|
---|
57 |
|
---|
58 | :noPerl
|
---|
59 | echo.
|
---|
60 | if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires Perl in order to operate,
|
---|
61 | if "%GLILANG%" == "en" echo but Perl could not be detected on your system. Please ensure that Perl
|
---|
62 | if "%GLILANG%" == "en" echo is installed and is on your search path, then try again.
|
---|
63 |
|
---|
64 | if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
|
---|
65 | if "%GLILANG%" == "es" echo operar, pero ste no aparece en su sistema. Por favor aseg£rese de
|
---|
66 | if "%GLILANG%" == "es" echo que Perl est instalado y se encuentra en su ruta de b£squeda.
|
---|
67 | if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
|
---|
68 |
|
---|
69 | if "%GLILANG%" == "fr" echo Greenstone Librarian Interface ncessite perl pour son fonctionnement,
|
---|
70 | if "%GLILANG%" == "fr" echo mais perl n'a pas pu tre dtect dans votre systme. Veuillez vous
|
---|
71 | if "%GLILANG%" == "fr" echo assurer que perl est install et est spcifi dans votre chemin de
|
---|
72 | if "%GLILANG%" == "fr" echo recherche, puis redmarrez ce script.
|
---|
73 |
|
---|
74 | if "%GLILANG%" == "ru" echo š¡«š®â¥çë© šâ¥à䥩á Greenstone âॡã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š®áâì
|
---|
75 | if "%GLILANG%" == "ru" echo à ¡®â âì, ® Perl ¥ ¡ë« ¢ ¢ 襩 ášá⥬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
|
---|
76 | if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ®¢«¥ š 宀šâáï ¢ 襬 ¯ãâš ¯®šáª , § ⥬
|
---|
77 | if "%GLILANG%" == "ru" echo ¯®¢â®à®¢¢¥€šâ¥ íâ®â áªàš¯â.
|
---|
78 | goto exit
|
---|
79 |
|
---|
80 | :exit
|
---|
81 |
|
---|
82 |
|
---|
83 |
|
---|
84 |
|
---|
85 |
|
---|