@echo off setlocal enabledelayedexpansion pushd "%CD%" CD /D "%~dp0" set GSDLLANG=en echo. echo. echo #### # echo ## # echo # ### ## ## ### ### ### ## ### ## echo # # # #### #### # # ## # # # # # #### echo ## # # # # # # # # # # # # # echo #### # ### ### # # ### ## ## # # ### echo (C) 2008, New Zealand Digital Library Project echo. echo. echo. if "!GSDLHOME!" == "" goto start if "!GSDLHOME!" == "!CD!" if not "!GSDLOS!" == "" ( echo Your environment is already set up for Greenstone goto done ) :start if "!OS!" == "Windows_NT" goto WinNT if "!OS!" == "" goto Win95 if "!GSDLLANG!" == "en" echo Setup failed - your PATH has not been set if "!GSDLLANG!" == "es" echo No se pudo realizar la configuraciвn - no se ha establecido la RUTA. if "!GSDLLANG!" == "fr" echo EchВc de l'installation - votre variable PATH n'a pas ВtВ ajustВe if "!GSDLLANG!" == "ru" echo Установка не удалась - ПУТЬ не был установлен goto End :WinNT set GSDLHOME=%CD% set GSDLOS=windows REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables. if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL=!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB=!GSDLHOME!\bin\windows\ghostscript\lib if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH=!GSDLHOME!\bin\windows\ghostscript\bin;!PATH! :: ImageMagick environment vars are now set in bin\script\gs-magick.pl ::if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH=!GSDLHOME!\bin\windows\imagemagick;!PATH! if "!GS_CP_SET!" == "yes" goto Success set PATH=!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH! if exist "!GSDLHOME!\bin\windows\perl\bin" ( set PERLPATH=!GSDLHOME!\bin\windows\perl\bin set PATH=!PERLPATH!;!PATH! ) set GS_CP_SET=yes goto Success :Win95 if "%1" == "SetEnv" goto Win95Env REM We'll invoke a second copy of the command processor to make REM sure there's enough environment space COMMAND /E:2048 /K %0 SetEnv goto End :Win95Env set GSDLHOME=%CD% set GSDLOS=windows REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables. if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL="!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB="!GSDLHOME!\bin\windows\ghostscript\lib" if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH="!GSDLHOME!\bin\windows\ghostscript\bin";"!PATH!" :: ImageMagick environment vars are now set in bin\script\gs-magick.pl ::if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH="!GSDLHOME!\bin\windows\imagemagick";"!PATH!" if "!GS_CP_SET!" == "yes" goto Success set PATH=!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH! if exist "!GSDLHOME!\bin\windows\perl\bin" ( set PERLPATH=!GSDLHOME!\bin\windows\perl\bin set PATH=!PERLPATH!;!PATH! ) set GS_CP_SET=yes goto Success :Success if "!GSDLLANG!" == "en" echo. if "!GSDLLANG!" == "en" echo Your environment has successfully been set up to run Greenstone. if "!GSDLLANG!" == "en" echo Note that these settings will only have effect within this MS-DOS if "!GSDLLANG!" == "en" echo session. You will therefore need to rerun setup.bat if you want if "!GSDLLANG!" == "en" echo to run Greenstone programs from a different MS-DOS session. if "!GSDLLANG!" == "en" echo. if "!GSDLLANG!" == "es" echo. if "!GSDLLANG!" == "es" echo Su ambiente ha sido configurado para correr los programas Greenstone. if "!GSDLLANG!" == "es" echo Recuerde que estos ajustes гnicamente tendrаn efecto dentro de esta sesiвn if "!GSDLLANG!" == "es" echo MS-DOS. Por lo tanto deberа ejecutar nuevamente setup.bat si desea if "!GSDLLANG!" == "es" echo correr los programas de Greenstone desde una sesiвn MS-DOS diferente. if "!GSDLLANG!" == "es" echo. if "!GSDLLANG!" == "fr" echo. if "!GSDLLANG!" == "fr" echo Votre environnement a ВtВ configuВre avec succКs pour exВcuter Greenstone if "!GSDLLANG!" == "fr" echo Notez que ces paramКtrages n'auront d'effet que dans cette session MS-DOS. if "!GSDLLANG!" == "fr" echo Vous devrez par consВquent rВexВcuter setup.bat si vous voulez faire if "!GSDLLANG!" == "fr" echo lancer des programmes Greenstone dans une autre session MS-DOS. if "!GSDLLANG!" == "fr" echo. if "!GSDLLANG!" == "ru" echo. if "!GSDLLANG!" == "ru" echo Ваше окружение было успешно настроено, чтобы установить Greenstone Обратите if "!GSDLLANG!" == "ru" echo внимание, что эти назначения будут только иметь эффект в пределах этого MS DOS if "!GSDLLANG!" == "ru" echo сессия. Вы будете поэтому должны повторно управлять setup.bat, если Вы хотите if "!GSDLLANG!" == "ru" echo управлять программами Зелёных изверженных пород от различной сессии MS DOS. if "!GSDLLANG!" == "ru" echo. :End endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS% set savedir=%CD% cd "%GSDLHOME%" if exist ext ( for /D %%e IN ("ext/*") do call :addexts %%e ) cd "%savedir%" set savedir= goto :doneexts :addexts set folder=%1 cd "ext\%folder%" if EXIST setup.bat call setup.bat cd ..\.. goto :eof :doneexts if exist "%GSDLHOME%\local\setup.bat" ( echo. echo Running %GSDLHOME%\local\setup.bat cd "%GSDLHOME%\local" call setup.bat cd "%GSDLHOME%" ) setlocal enabledelayedexpansion if exist "%GSDLHOME%\local" ( set PATH=!GSDLHOME!\local\bin;!PATH! ) if exist "%GSDLHOME%\apache-httpd" ( echo +Adding in executable path for apache-httpd set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\bin;!PATH! set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\lib;!PATH! ) :: test writability of GSDLHOME @call "!GSDLHOME!\bin\script\checkwritability.bat" :done popd endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS% :: Perl >= v5.18.* randomises map iteration order within a process set PERL_PERTURB_KEYS=0 :: The user can customise wget flags like number of retries and setting timeouts in the Wgetrc file. :: The WGETRC environment variable is used by wget to find a user wgetrc file overriding any system level one :: https://www.gnu.org/software/wget/manual/html_node/Wgetrc-Location.html set WGETRC=%GSDLHOME%/bin/%GSDLOS%/wgetrc