[17944] | 1 | echo off
|
---|
[24829] | 2 | setlocal enabledelayedexpansion
|
---|
| 3 |
|
---|
[17944] | 4 | pushd "%CD%"
|
---|
| 5 | CD /D "%~dp0"
|
---|
| 6 | set GLILANG=en
|
---|
| 7 |
|
---|
| 8 | :: This script must be run from within the directory in which it lives
|
---|
| 9 | if exist makejar.bat goto findJar
|
---|
| 10 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
| 11 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
| 12 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
| 13 | partir du rpertoire dans lequel il se trouve.
|
---|
| 14 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 15 | goto exit
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | :findJar
|
---|
| 21 | :: ---- Check jar exists ----
|
---|
| 22 | set JARPATH=
|
---|
| 23 |
|
---|
| 24 | :: Some users may set the above line manually
|
---|
| 25 | if not "%JARPATH%" == "" goto testJar
|
---|
| 26 |
|
---|
| 27 | :: If it is set, use the JAVA_HOME environment variable
|
---|
| 28 | if not "%JAVA_HOME%" == "" goto javahome
|
---|
| 29 |
|
---|
| 30 | :: Check if jar is on the search path
|
---|
| 31 | echo %PATH%| winutil\which.exe jar.exe | winutil\setvar.exe JARPATH > setjar.bat
|
---|
| 32 | call setjar.bat
|
---|
| 33 | del setjar.bat
|
---|
| 34 | if not "%JARPATH%" == "" goto testJar
|
---|
| 35 |
|
---|
| 36 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
| 37 | type nul > jdk.reg
|
---|
| 38 | regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
|
---|
| 39 | type jdk.reg > jdk.txt
|
---|
| 40 | del jdk.reg
|
---|
| 41 |
|
---|
| 42 | winutil\findjava.exe jdk.txt | winutil\setvar.exe JARPATH > setjar.bat
|
---|
| 43 | del jdk.txt
|
---|
| 44 | call setjar.bat
|
---|
| 45 | del setjar.bat
|
---|
| 46 |
|
---|
| 47 | :: If nothing was found in the registry, we're stuck
|
---|
| 48 | if "%JARPATH%" == "" goto noJar
|
---|
| 49 |
|
---|
| 50 | set JARPATH=%JARPATH%\bin
|
---|
| 51 | goto testJar
|
---|
| 52 |
|
---|
| 53 | :javahome
|
---|
| 54 | set JARPATH=%JAVA_HOME%\bin
|
---|
| 55 |
|
---|
| 56 | :testJar
|
---|
| 57 | :: Check that a jar executable has been found
|
---|
| 58 | if "%GLILANG%" == "en" echo Checking jar: %JARPATH%
|
---|
| 59 | if "%GLILANG%" == "es" echo Revisando jar: %JARPATH%
|
---|
| 60 | if "%GLILANG%" == "fr" echo Vrification de jar: %JARPATH%
|
---|
| 61 | if "%GLILANG%" == "ru" echo ஢¥àª jar: %JARPATH%
|
---|
| 62 | if exist "%JARPATH%\jar.exe" goto checkCompile
|
---|
| 63 |
|
---|
| 64 | :noJar
|
---|
| 65 | echo.
|
---|
| 66 | if "%GLILANG%" == "en" echo Failed to locate an appropriate version of jar. You must install a
|
---|
| 67 | if "%GLILANG%" == "en" echo Java Development Kit (version 1.4 or greater) before compiling the
|
---|
| 68 | if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
|
---|
| 69 |
|
---|
| 70 | if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de jar. Usted deber
|
---|
| 71 | if "%GLILANG%" == "es" echo instalar un Kit de Desarrollo de Software Java (versi¢n 1.4 o superior)
|
---|
| 72 | if "%GLILANG%" == "es" echo antes de generar la documentaci¢n para la Interfaz de la Biblioteca
|
---|
| 73 | if "%GLILANG%" == "es" echo Digital Greenstone.
|
---|
| 74 |
|
---|
| 75 | if "%GLILANG%" == "fr" echo Une version approprie de jar n'a pas pu tre localise. Vous devez
|
---|
| 76 | if "%GLILANG%" == "fr" echo installer un Kit de Dveloppement Java (version 1.4 ou suprieure)
|
---|
| 77 | if "%GLILANG%" == "fr" echo avant de produire la documentation de Greenstone Librarian Interface.
|
---|
| 78 |
|
---|
| 79 | if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥á⮠宊€¥š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš jar.
|
---|
| 80 | if "%GLILANG%" == "ru" echo ë €®«Šë šáâ ««šà®¢ âì Java Development Kit (¢¥àášï 1.4 š«š ¢ëè¥)
|
---|
| 81 | if "%GLILANG%" == "ru" echo ¯à¥Š€¥, 祬 £¥¥àšà®¢ âì €®ªã¬¥â æšî €«ï ¡š¡«š®â¥ç®£®
|
---|
| 82 | if "%GLILANG%" == "ru" echo šâ¥à䥩á Greenstone.
|
---|
| 83 | goto exit
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | :checkCompile
|
---|
| 88 | :: Check that the GLI has been compiled
|
---|
| 89 | if exist classes\org\greenstone\gatherer\GathererProg.class goto makeJar
|
---|
| 90 | if "%GLILANG%" == "es" (
|
---|
[22096] | 91 | echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
|
---|
[17944] | 92 | echo ^(por medio de makegli.sh^) antes de ejecutar este guión.
|
---|
| 93 | )
|
---|
[22096] | 94 | if "%GLILANG%" == "fr" (
|
---|
[17944] | 95 | echo Vous devez compiler le Greenstone Interface ^(en utilisant makegli.sh^)
|
---|
| 96 | echo avant d'exécuter ce script.
|
---|
| 97 | )
|
---|
| 98 | if "%GLILANG%" == "ru" (
|
---|
[22096] | 99 | echo ÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone
|
---|
[17944] | 100 | echo ^(ÉÓÐÏÌØÚÕÑ makegli.sh^) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ
|
---|
| 101 | )
|
---|
[22096] | 102 | if "%GLILANG%" == "en" (
|
---|
[17944] | 103 | echo You need to compile the Greenstone Librarian Interface ^(using makegli.sh^)
|
---|
| 104 | echo before running this script.
|
---|
| 105 | )
|
---|
| 106 | goto exit
|
---|
| 107 | fi
|
---|
| 108 |
|
---|
| 109 |
|
---|
[24782] | 110 | :makeJar
|
---|
| 111 | :: All the GLI class files and supporting libraries are put into the "jar" directory
|
---|
[17944] | 112 |
|
---|
| 113 | echo Assuming that Java code is freshly compiled...
|
---|
| 114 |
|
---|
| 115 | if NOT exist jar (
|
---|
| 116 | mkdir jar
|
---|
[24782] | 117 |
|
---|
[24829] | 118 | cd jar
|
---|
| 119 | "!JARPATH!\jar" xf ..\lib\apache.jar com org
|
---|
[17944] | 120 | "!JARPATH!\jar" xf ..\lib\qfslib.jar de
|
---|
| 121 |
|
---|
| 122 | cd ..
|
---|
| 123 | )
|
---|
| 124 |
|
---|
| 125 | :: Copy the latest version of the GLI classes into the jar directory
|
---|
| 126 | if exist jar\org\greenstone (
|
---|
| 127 | rmdir /q /s jar\org\greenstone
|
---|
| 128 | )
|
---|
| 129 | xcopy /i /e /q classes\org\greenstone jar\org\greenstone
|
---|
| 130 |
|
---|
| 131 | :: Some of the things to go into the JAR file are optional, and may not exist
|
---|
| 132 | set optional=
|
---|
| 133 | if exist collect.zip (
|
---|
| 134 | set optional=%optional% collect.zip
|
---|
| 135 | )
|
---|
| 136 |
|
---|
[18292] | 137 | :: Recreate the metadata.zip file (contains the GLI metadata directory)
|
---|
[17944] | 138 | if exist metadata.zip (
|
---|
| 139 | del /f metadata.zip
|
---|
| 140 | )
|
---|
| 141 | winutil\zip.exe -r metadata.zip metadata >NUL
|
---|
| 142 |
|
---|
| 143 | :: Jar everything up
|
---|
| 144 | "%JARPATH%\jar" cf GLI.jar .java.policy metadata.zip %optional% help -C classes dictionary.properties -C classes dictionary_es.properties -C classes dictionary_fr.properties -C classes dictionary_ru.properties -C classes feedback.properties -C classes images -C classes xml -C jar com -C jar de -C jar org
|
---|
| 145 |
|
---|
| 146 | :: Tidy up
|
---|
| 147 | del /f metadata.zip
|
---|
| 148 |
|
---|
| 149 | :: Generate the GLIServer.jar file for remote building
|
---|
| 150 | "%JARPATH%\jar" cf GLIServer.jar -C classes org/greenstone/gatherer/remote
|
---|
| 151 |
|
---|
| 152 | :: ---- Make signed JAR file for the applet, if desired ----
|
---|
| 153 | if (%1) == (-sign) (
|
---|
| 154 |
|
---|
[24829] | 155 | if not exist appletstore (
|
---|
[17944] | 156 | "!JARPATH!\keytool" -genkey -alias privateKey -keystore appletstore -storepass greenstone
|
---|
| 157 | )
|
---|
| 158 |
|
---|
| 159 | if exist SignedGatherer.jar del /f SignedGatherer.jar
|
---|
| 160 | if exist appletpasswd (
|
---|
[24829] | 161 | echo Using jarsigner to make signed jar file ...
|
---|
[17944] | 162 | "!JARPATH!\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey < appletpasswd >NUL 2>NUL
|
---|
| 163 | echo ... done.
|
---|
[24829] | 164 | ) ELSE (
|
---|
[17944] | 165 | "!JARPATH!\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey
|
---|
| 166 | )
|
---|
| 167 | echo Installing SignedGatherer in ..\bin\java
|
---|
| 168 | move SignedGatherer.jar ..\bin\java\SignedGatherer.jar
|
---|
| 169 | )
|
---|
| 170 | :exit
|
---|
| 171 |
|
---|
[24829] | 172 | popd
|
---|
| 173 | endlocal
|
---|