1*cdf0e10cSrcweir@echo off 2*cdf0e10cSrcweirREM This script sets all enviroment variables, which 3*cdf0e10cSrcweirREM are necessary for building the examples of the Office Development Kit. 4*cdf0e10cSrcweirREM The Script was developed for the operating systems Windows. 5*cdf0e10cSrcweirREM The SDK name 6*cdf0e10cSrcweirREM Example: set OO_SDK_NAME=openoffice3.0_sdk 7*cdf0e10cSrcweirset OO_SDK_NAME=openoffice.org3.0_sdk 8*cdf0e10cSrcweir 9*cdf0e10cSrcweirREM Installation directory of the Software Development Kit. 10*cdf0e10cSrcweirREM Example: set OO_SDK_HOME=C:\Program Files\OpenOffice.org\Basic 3.0\sdk 11*cdf0e10cSrcweirset OO_SDK_HOME= 12*cdf0e10cSrcweir 13*cdf0e10cSrcweirREM Office installation directory. 14*cdf0e10cSrcweirREM Example: set OFFICE_HOME=C:\Program Files\OpenOffice.org 3 15*cdf0e10cSrcweirset OFFICE_HOME= 16*cdf0e10cSrcweir 17*cdf0e10cSrcweirREM Example: set OFFICE_HOME=C:\Program Files\OpenOffice.org\Basis 3.0 18*cdf0e10cSrcweirset OFFICE_BASE_HOME= 19*cdf0e10cSrcweir 20*cdf0e10cSrcweirREM URE installation directory. 21*cdf0e10cSrcweirREM Example: set OO_SDK_URE_HOME=C:\Program Files\OpenOffice.org\URE 22*cdf0e10cSrcweirset OO_SDK_URE_HOME= 23*cdf0e10cSrcweir 24*cdf0e10cSrcweirREM Directory of the make command. 25*cdf0e10cSrcweirREM Example: set OO_SDK_MAKE_HOME=D:\NextGenerationMake\make 26*cdf0e10cSrcweirset OO_SDK_MAKE_HOME= 27*cdf0e10cSrcweir 28*cdf0e10cSrcweirREM Directory of the zip tool. 29*cdf0e10cSrcweirREM Example: set OO_SDK_ZIP_HOME=D:\infozip\bin 30*cdf0e10cSrcweirset OO_SDK_ZIP_HOME= 31*cdf0e10cSrcweir 32*cdf0e10cSrcweirREM Directory of the C++ compiler. 33*cdf0e10cSrcweirREM Example:set OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin 34*cdf0e10cSrcweirREM Example:set CPP_WINDOWS_SDK=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\ 35*cdf0e10cSrcweirset OO_SDK_CPP_HOME= 36*cdf0e10cSrcweirset CPP_VC8= 37*cdf0e10cSrcweirset CPP_WINDOWS_SDK= 38*cdf0e10cSrcweir 39*cdf0e10cSrcweirREM Directory of the C# and VB.NET compilers. 40*cdf0e10cSrcweirREM Example:set OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705 41*cdf0e10cSrcweirset OO_SDK_CLI_HOME= 42*cdf0e10cSrcweir 43*cdf0e10cSrcweirREM Java SDK installation directory. 44*cdf0e10cSrcweirREM Example: set OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05 45*cdf0e10cSrcweirset OO_SDK_JAVA_HOME= 46*cdf0e10cSrcweir 47*cdf0e10cSrcweirREM Special output directory 48*cdf0e10cSrcweirREM Example: set OO_SDK_OUT=C:\openoffice.org3.0_sdk 49*cdf0e10cSrcweirset OO_SDK_OUT= 50*cdf0e10cSrcweir 51*cdf0e10cSrcweirREM Automatic deployment 52*cdf0e10cSrcweirREM Example: set SDK_AUTO_DEPLOYMENT=YES 53*cdf0e10cSrcweirset SDK_AUTO_DEPLOYMENT=YES 54*cdf0e10cSrcweir 55*cdf0e10cSrcweirset STLDEBUG= 56*cdf0e10cSrcweirREM check stlport lib in 4NT shell 57*cdf0e10cSrcweirREM if exist "%OO_SDK_HOME%\windows\lib\stlport_vc71_stldebug.lib". ( 58*cdf0e10cSrcweirREM set STLDEBUG=_stldebug 59*cdf0e10cSrcweirREM ) 60*cdf0e10cSrcweir 61*cdf0e10cSrcweirREM Check installation path for the StarOffice Development Kit. 62*cdf0e10cSrcweirif not defined OO_SDK_HOME ( 63*cdf0e10cSrcweir echo Error: the variable OO_SDK_HOME is missing! 64*cdf0e10cSrcweir goto :error 65*cdf0e10cSrcweir ) 66*cdf0e10cSrcweir 67*cdf0e10cSrcweirREM Check installation path for the office. 68*cdf0e10cSrcweirREM if not defined OFFICE_HOME ( 69*cdf0e10cSrcweirREM if not defined OO_SDK_URE_HOME ( 70*cdf0e10cSrcweirREM echo Error: either of the variables OFFICE_HOME and 71*cdf0e10cSrcweirREM echo OO_SDK_URE_HOME is missing! 72*cdf0e10cSrcweirREM goto :error 73*cdf0e10cSrcweirREM ) 74*cdf0e10cSrcweirREM ) 75*cdf0e10cSrcweir 76*cdf0e10cSrcweirREM Check installation path for GNU make. 77*cdf0e10cSrcweirif not defined OO_SDK_MAKE_HOME ( 78*cdf0e10cSrcweir echo Error: the variable OO_SDK_MAKE_HOME is missing! 79*cdf0e10cSrcweir goto :error 80*cdf0e10cSrcweir ) 81*cdf0e10cSrcweir 82*cdf0e10cSrcweirREM Check installation path for the zip tool. 83*cdf0e10cSrcweirif not defined OO_SDK_ZIP_HOME ( 84*cdf0e10cSrcweir echo Error: the variable OO_SDK_ZIP_HOME is missing! 85*cdf0e10cSrcweir goto :error 86*cdf0e10cSrcweir ) 87*cdf0e10cSrcweir 88*cdf0e10cSrcweirREM Set library path. 89*cdf0e10cSrcweirset LIB=%OO_SDK_HOME%\lib;%LIB% 90*cdf0e10cSrcweirif defined CPP_WINDOWS_SDK ( 91*cdf0e10cSrcweir set LIB=%LIB%;%CPP_WINDOWS_SDK%\lib 92*cdf0e10cSrcweir ) 93*cdf0e10cSrcweir 94*cdf0e10cSrcweirREM Set office program path. 95*cdf0e10cSrcweirif defined OFFICE_HOME ( 96*cdf0e10cSrcweir set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program 97*cdf0e10cSrcweir ) 98*cdf0e10cSrcweir 99*cdf0e10cSrcweirREM Set office program path. 100*cdf0e10cSrcweirif defined OFFICE_BASE_HOME ( 101*cdf0e10cSrcweir set OFFICE_BASE_PROGRAM_PATH=%OFFICE_BASE_HOME%\program 102*cdf0e10cSrcweir ) 103*cdf0e10cSrcweir 104*cdf0e10cSrcweirREM Set UNO path, necessary to ensure that the cpp examples using the 105*cdf0e10cSrcweirREM new UNO bootstrap mechanism use the configured office installation 106*cdf0e10cSrcweirREM (only set when using an Office). 107*cdf0e10cSrcweirif defined OFFICE_HOME ( 108*cdf0e10cSrcweir set UNO_PATH=%OFFICE_PROGRAM_PATH% 109*cdf0e10cSrcweir ) 110*cdf0e10cSrcweir 111*cdf0e10cSrcweirREM if defined OO_SDK_URE_HOME ( 112*cdf0e10cSrcweirset OO_SDK_URE_BIN_DIR=%OO_SDK_URE_HOME%\bin 113*cdf0e10cSrcweirset OO_SDK_URE_LIB_DIR=%OO_SDK_URE_HOME%\bin 114*cdf0e10cSrcweirset OO_SDK_URE_JAVA_DIR=%OO_SDK_URE_HOME%\java 115*cdf0e10cSrcweirREM ) else ( 116*cdf0e10cSrcweirset OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH% 117*cdf0e10cSrcweirset OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH% 118*cdf0e10cSrcweirset OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes 119*cdf0e10cSrcweirREM ) 120*cdf0e10cSrcweir 121*cdf0e10cSrcweirREM Set classpath 122*cdf0e10cSrcweirset CLASSPATH=%OO_SDK_URE_JAVA_DIR%\juh.jar;%OO_SDK_URE_JAVA_DIR%\jurt.jar;%OO_SDK_URE_JAVA_DIR%\ridl.jar;%OO_SDK_URE_JAVA_DIR%\unoloader.jar;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar 123*cdf0e10cSrcweirREM if defined OFFICE_HOME ( 124*cdf0e10cSrcweirREM set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar 125*cdf0e10cSrcweirREM ) 126*cdf0e10cSrcweir 127*cdf0e10cSrcweirREM Add directory of the SDK tools to the path. 128*cdf0e10cSrcweirset PATH=%OO_SDK_HOME%\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\WINexample.out\bin;%PATH% 129*cdf0e10cSrcweir 130*cdf0e10cSrcweirREM Set PATH appropriate to the output directory 131*cdf0e10cSrcweirif defined OO_SDK_OUT ( 132*cdf0e10cSrcweir set PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH% 133*cdf0e10cSrcweir ) else ( 134*cdf0e10cSrcweir set PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH% 135*cdf0e10cSrcweir ) 136*cdf0e10cSrcweir 137*cdf0e10cSrcweirREM Add directory of the command make to the path, if necessary. 138*cdf0e10cSrcweirif defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH% 139*cdf0e10cSrcweir 140*cdf0e10cSrcweirREM Add directory of the zip tool to the path, if necessary. 141*cdf0e10cSrcweirif defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH% 142*cdf0e10cSrcweir 143*cdf0e10cSrcweirREM Add directory of the C++ compiler to the path, if necessary. 144*cdf0e10cSrcweirif defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH% 145*cdf0e10cSrcweir 146*cdf0e10cSrcweirREM Add directory of the C# and VB.NET compilers to the path, if necessary. 147*cdf0e10cSrcweirif defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH% 148*cdf0e10cSrcweir 149*cdf0e10cSrcweirREM Add directory of the Java tools to the path, if necessary. 150*cdf0e10cSrcweirif defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH% 151*cdf0e10cSrcweir 152*cdf0e10cSrcweirREM Set environment for C++ compiler tools, if necessary. 153*cdf0e10cSrcweirif defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat" 154*cdf0e10cSrcweir 155*cdf0e10cSrcweirREM Set tilte to identify the prepared shell. 156*cdf0e10cSrcweirtitle Shell prepared for SDK 157*cdf0e10cSrcweir 158*cdf0e10cSrcweirREM Prepare shell with all necessary environment variables. 159*cdf0e10cSrcweirecho. 160*cdf0e10cSrcweirecho ****************************************************************** 161*cdf0e10cSrcweirecho * 162*cdf0e10cSrcweirecho * SDK environment is prepared for Windows 163*cdf0e10cSrcweirecho * 164*cdf0e10cSrcweirecho * SDK = %OO_SDK_HOME% 165*cdf0e10cSrcweirecho * Office = %OFFICE_HOME% 166*cdf0e10cSrcweirecho * Office Base = %OFFICE_BASE_HOME% 167*cdf0e10cSrcweirecho * URE = %OO_SDK_URE_HOME% 168*cdf0e10cSrcweirecho * Make = %OO_SDK_MAKE_HOME% 169*cdf0e10cSrcweirecho * Zip = %OO_SDK_ZIP_HOME% 170*cdf0e10cSrcweirecho * C++ Compiler = %OO_SDK_CPP_HOME% 171*cdf0e10cSrcweirecho * C# and VB.NET compilers = %OO_SDK_CLI_HOME% 172*cdf0e10cSrcweirecho * Java = %OO_SDK_JAVA_HOME% 173*cdf0e10cSrcweirecho * Special Output directory = %OO_SDK_OUT% 174*cdf0e10cSrcweirecho * Auto deployment = %SDK_AUTO_DEPLOYMENT% 175*cdf0e10cSrcweirecho * 176*cdf0e10cSrcweirecho ****************************************************************** 177*cdf0e10cSrcweirecho. 178*cdf0e10cSrcweirgoto end 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir :error 181*cdf0e10cSrcweirError: Please insert the necessary environment variables into the batch file. 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir :end 184