root/main/trunk/greenstone2/setup.bat @ 23652

Revision 23652, 5.4 KB (checked in by ak19, 9 years ago)

Minor correction to previous fix: need to go up two dir levels in relative fashion or have to use delayedexpansion. Previous commit: Fixes to get OpenOffice? plugin's options to show up in GLI without calling GS2's setup.bat manually (it should be called by gli.bat). It wasn't getting called anymore because of the newly added setup.bat file in the openoffice extension, whose subtle interactions with the rest of the gli.bat procedure caused the call to GS2's setup.bat to be skipped.

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