1 | @echo off
|
---|
2 |
|
---|
3 | setlocal enabledelayedexpansion
|
---|
4 |
|
---|
5 | pushd "%CD%"
|
---|
6 | CD /D "%~dp0"
|
---|
7 | set GSDLLANG=en
|
---|
8 |
|
---|
9 | echo.
|
---|
10 | echo.
|
---|
11 | echo #### #
|
---|
12 | echo ## #
|
---|
13 | echo # ### ## ## ### ### ### ## ### ##
|
---|
14 | echo # # # #### #### # # ## # # # # # ####
|
---|
15 | echo ## # # # # # # # # # # # # #
|
---|
16 | echo #### # ### ### # # ### ## ## # # ###
|
---|
17 | echo (C) 2008, New Zealand Digital Library Project
|
---|
18 | echo.
|
---|
19 | echo.
|
---|
20 | echo.
|
---|
21 |
|
---|
22 | if "!GSDLHOME!" == "" goto start
|
---|
23 | if "!GSDLHOME!" == "!CD!" if not "!GSDLOS!" == "" (
|
---|
24 | echo Your environment is already set up for Greenstone
|
---|
25 | goto done
|
---|
26 | )
|
---|
27 |
|
---|
28 | :start
|
---|
29 | if "!OS!" == "Windows_NT" goto WinNT
|
---|
30 | if "!OS!" == "" goto Win95
|
---|
31 | if "!GSDLLANG!" == "en" echo Setup failed - your PATH has not been set
|
---|
32 | if "!GSDLLANG!" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
|
---|
33 | if "!GSDLLANG!" == "fr" echo Echc de l'installation - votre variable PATH n'a pas t ajuste
|
---|
34 | if "!GSDLLANG!" == "ru" echo áâ ®¢ª ¥ 〠« áì - ¥ ¡ë« ãáâ ®¢«¥
|
---|
35 | goto End
|
---|
36 |
|
---|
37 | :WinNT
|
---|
38 | set GSDLHOME=%CD%
|
---|
39 | set GSDLOS=windows
|
---|
40 |
|
---|
41 | REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
|
---|
42 | if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL=!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll
|
---|
43 | if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB=!GSDLHOME!\bin\windows\ghostscript\lib
|
---|
44 | if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH=!GSDLHOME!\bin\windows\ghostscript\bin;!PATH!
|
---|
45 | :: ImageMagick environment vars are now set in bin\script\gs-magick.pl
|
---|
46 | ::if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH=!GSDLHOME!\bin\windows\imagemagick;!PATH!
|
---|
47 |
|
---|
48 | if "!GS_CP_SET!" == "yes" goto Success
|
---|
49 | set PATH=!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
|
---|
50 | if exist "!GSDLHOME!\bin\windows\perl\bin" (
|
---|
51 | set PERLPATH=!GSDLHOME!\bin\windows\perl\bin
|
---|
52 | set PATH=!PERLPATH!;!PATH!
|
---|
53 | )
|
---|
54 |
|
---|
55 | set GS_CP_SET=yes
|
---|
56 | goto Success
|
---|
57 |
|
---|
58 | :Win95
|
---|
59 | if "%1" == "SetEnv" goto Win95Env
|
---|
60 | REM We'll invoke a second copy of the command processor to make
|
---|
61 | REM sure there's enough environment space
|
---|
62 | COMMAND /E:2048 /K %0 SetEnv
|
---|
63 | goto End
|
---|
64 |
|
---|
65 | :Win95Env
|
---|
66 | set GSDLHOME=%CD%
|
---|
67 | set GSDLOS=windows
|
---|
68 |
|
---|
69 | REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
|
---|
70 | if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL="!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll"
|
---|
71 | if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB="!GSDLHOME!\bin\windows\ghostscript\lib"
|
---|
72 | if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH="!GSDLHOME!\bin\windows\ghostscript\bin";"!PATH!"
|
---|
73 | :: ImageMagick environment vars are now set in bin\script\gs-magick.pl
|
---|
74 | ::if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH="!GSDLHOME!\bin\windows\imagemagick";"!PATH!"
|
---|
75 |
|
---|
76 | if "!GS_CP_SET!" == "yes" goto Success
|
---|
77 | set PATH=!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
|
---|
78 | if exist "!GSDLHOME!\bin\windows\perl\bin" (
|
---|
79 | set PERLPATH=!GSDLHOME!\bin\windows\perl\bin
|
---|
80 | set PATH=!PERLPATH!;!PATH!
|
---|
81 | )
|
---|
82 | set GS_CP_SET=yes
|
---|
83 | goto Success
|
---|
84 |
|
---|
85 |
|
---|
86 | :Success
|
---|
87 | if "!GSDLLANG!" == "en" echo.
|
---|
88 | if "!GSDLLANG!" == "en" echo Your environment has successfully been set up to run Greenstone.
|
---|
89 | if "!GSDLLANG!" == "en" echo Note that these settings will only have effect within this MS-DOS
|
---|
90 | if "!GSDLLANG!" == "en" echo session. You will therefore need to rerun setup.bat if you want
|
---|
91 | if "!GSDLLANG!" == "en" echo to run Greenstone programs from a different MS-DOS session.
|
---|
92 | if "!GSDLLANG!" == "en" echo.
|
---|
93 |
|
---|
94 | if "!GSDLLANG!" == "es" echo.
|
---|
95 | if "!GSDLLANG!" == "es" echo Su ambiente ha sido configurado para correr los programas Greenstone.
|
---|
96 | if "!GSDLLANG!" == "es" echo Recuerde que estos ajustes £nicamente tendr n efecto dentro de esta sesi¢n
|
---|
97 | if "!GSDLLANG!" == "es" echo MS-DOS. Por lo tanto deber ejecutar nuevamente setup.bat si desea
|
---|
98 | if "!GSDLLANG!" == "es" echo correr los programas de Greenstone desde una sesi¢n MS-DOS diferente.
|
---|
99 | if "!GSDLLANG!" == "es" echo.
|
---|
100 |
|
---|
101 | if "!GSDLLANG!" == "fr" echo.
|
---|
102 | if "!GSDLLANG!" == "fr" echo Votre environnement a t configure avec succs pour excuter Greenstone
|
---|
103 | if "!GSDLLANG!" == "fr" echo Notez que ces paramtrages n'auront d'effet que dans cette session MS-DOS.
|
---|
104 | if "!GSDLLANG!" == "fr" echo Vous devrez par consquent rexcuter setup.bat si vous voulez faire
|
---|
105 | if "!GSDLLANG!" == "fr" echo lancer des programmes Greenstone dans une autre session MS-DOS.
|
---|
106 | if "!GSDLLANG!" == "fr" echo.
|
---|
107 |
|
---|
108 | if "!GSDLLANG!" == "ru" echo.
|
---|
109 | if "!GSDLLANG!" == "ru" echo è¥ ®ªà㊥š¥ ¡ë«® ãá¯¥è® áâ஥®, ç⮡ë ãáâ ®¢šâì Greenstone ¡à âšâ¥
|
---|
110 | if "!GSDLLANG!" == "ru" echo ¢š¬ š¥, çâ® íâš § ç¥šï ¡ã€ãâ ⮫쪮 š¬¥âì íä䥪⠢ ¯à¥€¥« å í⮣® MS DOS
|
---|
111 | if "!GSDLLANG!" == "ru" echo á¥áášï. ë ¡ã€¥â¥ ¯®í⮬㠀®«Šë ¯®¢â®à® ã¯à ¢«ïâì setup.bat, ¥á«š ë å®âšâ¥
|
---|
112 | if "!GSDLLANG!" == "ru" echo ã¯à ¢«ïâì ¯à®£à ¬¬ ¬š ¥«ñëå š§¢¥àŠ¥ëå ¯®à®€ ®â à §«šç®© á¥áášš MS DOS.
|
---|
113 | if "!GSDLLANG!" == "ru" echo.
|
---|
114 |
|
---|
115 | :End
|
---|
116 | endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%
|
---|
117 |
|
---|
118 | set savedir=%CD%
|
---|
119 | cd "%GSDLHOME%"
|
---|
120 | if exist ext (
|
---|
121 | for /D %%e IN ("ext/*") do call :addexts %%e
|
---|
122 | )
|
---|
123 | cd "%savedir%"
|
---|
124 | set savedir=
|
---|
125 | goto :doneexts
|
---|
126 |
|
---|
127 | :addexts
|
---|
128 | set folder=%1
|
---|
129 | cd "ext\%folder%"
|
---|
130 | if EXIST setup.bat call setup.bat
|
---|
131 | cd ..\..
|
---|
132 | goto :eof
|
---|
133 |
|
---|
134 | :doneexts
|
---|
135 | setlocal enabledelayedexpansion
|
---|
136 |
|
---|
137 | if exist "%GSDLHOME%\apache-httpd" (
|
---|
138 | echo +Adding in executable path for apache-httpd
|
---|
139 | set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\bin;!PATH!
|
---|
140 | set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\lib;!PATH!
|
---|
141 | )
|
---|
142 |
|
---|
143 | if exist "%GSDLHOME%\local" (
|
---|
144 | if exist "!GSDLHOME!\local\setup.bat" (
|
---|
145 | echo.
|
---|
146 | echo Running !GSDLHOME!\local\setup.bat
|
---|
147 | cd "!GSDLHOME!\local"
|
---|
148 | call setup.bat
|
---|
149 | cd "!GSDLHOME!"
|
---|
150 | )
|
---|
151 | set PATH=!GSDLHOME!\local\bin;!PATH!
|
---|
152 | )
|
---|
153 |
|
---|
154 | :: test writability of GSDLHOME
|
---|
155 | @call "!GSDLHOME!\bin\script\checkwritability.bat"
|
---|
156 |
|
---|
157 | :done
|
---|
158 | popd
|
---|
159 | endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%
|
---|