source: gs2-extensions/pdf-box/trunk/java/setup.bat@ 28335

Last change on this file since 28335 was 23653, checked in by ak19, 13 years ago

Sam had discovered that env variables in Win Batch files that occur inside round brackets of if-else stmts need to be using setdelayedexpansion (where exclamation marks replace percent signs). Updated this for 3 setup.bat files in the extensions folder.

File size: 1.5 KB
Line 
1@echo off
2pushd "%CD%"
3CD /D "%~dp0"
4
5set extdesc=the PDFBox Extension
6
7if "%OS%" == "Windows_NT" goto WinNT
8if "%OS%" == "" goto Win95
9if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
10if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
11if "%GSDLLANG%" == "fr" echo Ech‚c de l'installation - votre variable PATH n'a pas ‚t‚ ajust‚e
12if "%GSDLLANG%" == "ru" echo “áâ ­®¢ª  ­¥ ã€ « áì - “’œ ­¥ ¡ë« ãáâ ­®¢«¥­
13goto End
14
15:WinNT
16set GEXT_PDFBOX=%CD%
17set PATH=%GEXT_PDFBOX%\bin\script;%PATH%
18set PATH=%GEXT_PDFBOX%\lib;%PATH%
19set GS_CP_SET=yes
20goto Success
21
22:Win95
23if "%1" == "SetEnv" goto Win95Env
24REM We'll invoke a second copy of the command processor to make
25REM sure there's enough environment space
26COMMAND /E:2048 /K %0 SetEnv
27goto End
28
29:Win95Env
30set GEXT_PDFBOX=%CD%
31set PATH="%GEXT_PDFBOX%\bin\script";"%PATH%"
32set PATH="%GEXT_PDFBOX%\lib";"%PATH%"
33set GS_CP_SET=yes
34goto Success
35
36:Success
37
38set fulldir=%~dp0
39
40:: strip off everything up to (and including) ext dir
41set extdir=%fulldir:*ext\=%
42
43:: remove trailing slash
44set extdir=%extdir:\=%
45
46setlocal enabledelayedexpansion
47if "x%GSDLEXTS%" == "x" (
48 set GSDLEXTS=!extdir!
49) else (
50 set GSDLEXTS=!GSDLEXTS!:!extdir!
51)
52endlocal & set GSDLEXTS=%GSDLEXTS%
53
54echo +Your environment is now setup for %extdesc%
55
56:: Back to delayed expansion to avoid problems with environment
57:: variables with brackets in them, such as "Program Files (x86)"
58
59
60:End
61
62popd
Note: See TracBrowser for help on using the repository browser.