1cdf0e10cSrcweir@echo off
2d1bc5a71SJürgen SchmidtREM This script sets all enviroment variables, which
3cdf0e10cSrcweirREM are necessary for building the examples of the Office Development Kit.
4cdf0e10cSrcweirREM The Script was developed for the operating systems Windows.
5cdf0e10cSrcweirREM The SDK name
6*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_NAME=openoffice4.0_sdk"
7*7477dbb9SJürgen Schmidt@set "OO_SDK_NAME=<your_input_here>"
8cdf0e10cSrcweir
9cdf0e10cSrcweirREM Installation directory of the Software Development Kit.
10*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_HOME=C:\Program Files\OpenOffice\4\sdk"
11*7477dbb9SJürgen Schmidt@set "OO_SDK_HOME=<your_input_here>"
12cdf0e10cSrcweir
13cdf0e10cSrcweirREM Office installation directory.
14*7477dbb9SJürgen SchmidtREM Example: @set "OFFICE_HOME=C:\Program Files\OpenOffice 4"
15*7477dbb9SJürgen Schmidt@set "OFFICE_HOME=<your_input_here>"
16cdf0e10cSrcweir
17cdf0e10cSrcweirREM Directory of the make command.
18*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_MAKE_HOME=C:\UnxUtils\usr\local\wbin"
19*7477dbb9SJürgen Schmidt@set "OO_SDK_MAKE_HOME=<your_input_here>"
20cdf0e10cSrcweir
21cdf0e10cSrcweirREM Directory of the zip tool.
22*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_ZIP_HOME=C:\UnxUtils\usr\local\wbin"
23*7477dbb9SJürgen Schmidt@set "OO_SDK_ZIP_HOME=<your_input_here>"
24cdf0e10cSrcweir
25985d02c7SAriel Constenla-HaileREM Directory of the cat tool.
26*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_CAT_HOME=C:\UnxUtils\usr\local\wbin"
27*7477dbb9SJürgen Schmidt@set "OO_SDK_CAT_HOME=<your_input_here>"
28985d02c7SAriel Constenla-Haile
29985d02c7SAriel Constenla-HaileREM Directory of the sed tool.
30*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_SED_HOME=C:\UnxUtils\usr\local\wbin"
31*7477dbb9SJürgen Schmidt@set "OO_SDK_SED_HOME=<your_input_here>"
32985d02c7SAriel Constenla-Haile
33cdf0e10cSrcweirREM Directory of the C++ compiler.
34*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin"
35*7477dbb9SJürgen Schmidt@set "OO_SDK_CPP_HOME=<your_input_here>"
36*7477dbb9SJürgen Schmidt@set "CPP_MANIFEST=true"
37*7477dbb9SJürgen Schmidt@set "CPP_WINDOWS_SDK=<your_input_here>"
38cdf0e10cSrcweir
39cdf0e10cSrcweirREM Directory of the C# and VB.NET compilers.
40*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705"
41*7477dbb9SJürgen Schmidt@set "OO_SDK_CLI_HOME=<your_input_here>"
42cdf0e10cSrcweir
43cdf0e10cSrcweirREM Java SDK installation directory.
44*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05"
45*7477dbb9SJürgen Schmidt@set "OO_SDK_JAVA_HOME=<your_input_here>"
46cdf0e10cSrcweir
47cdf0e10cSrcweirREM Special output directory
48*7477dbb9SJürgen SchmidtREM Example: @set "OO_SDK_OUT=C:\openoffice4.0_sdk"
49*7477dbb9SJürgen Schmidt@set "OO_SDK_OUT=<your_input_here>"
50cdf0e10cSrcweir
51cdf0e10cSrcweirREM Automatic deployment
52*7477dbb9SJürgen SchmidtREM Example: @set "SDK_AUTO_DEPLOYMENT=YES"
53*7477dbb9SJürgen Schmidt@set "SDK_AUTO_DEPLOYMENT=YES"
54cdf0e10cSrcweir
55b3ba5bc7SJürgen SchmidtREM Check installation path for the Office Development Kit.
56cdf0e10cSrcweirif not defined OO_SDK_HOME (
57cdf0e10cSrcweir   echo Error: the variable OO_SDK_HOME is missing!
58*7477dbb9SJürgen Schmidt   goto :error
59cdf0e10cSrcweir )
60cdf0e10cSrcweir
61*7477dbb9SJürgen Schmidt
62cdf0e10cSrcweirREM Check installation path for GNU make.
63cdf0e10cSrcweirif not defined OO_SDK_MAKE_HOME (
64cdf0e10cSrcweir   echo Error: the variable OO_SDK_MAKE_HOME is missing!
65*7477dbb9SJürgen Schmidt   goto :error
66cdf0e10cSrcweir )
67cdf0e10cSrcweir
68cdf0e10cSrcweirREM Check installation path for the zip tool.
69cdf0e10cSrcweirif not defined OO_SDK_ZIP_HOME (
70cdf0e10cSrcweir   echo Error: the variable OO_SDK_ZIP_HOME is missing!
71*7477dbb9SJürgen Schmidt   goto :error
72cdf0e10cSrcweir )
73cdf0e10cSrcweir
74985d02c7SAriel Constenla-HaileREM Check installation path for the cat tool.
75985d02c7SAriel Constenla-Haileif not defined OO_SDK_CAT_HOME (
76985d02c7SAriel Constenla-Haile   echo Error: the variable OO_SDK_CAT_HOME is missing!
77*7477dbb9SJürgen Schmidt   goto :error
78985d02c7SAriel Constenla-Haile )
79985d02c7SAriel Constenla-Haile
80985d02c7SAriel Constenla-HaileREM Check installation path for the sed tool.
81985d02c7SAriel Constenla-Haileif not defined OO_SDK_SED_HOME (
82985d02c7SAriel Constenla-Haile   echo Error: the variable OO_SDK_SED_HOME is missing!
83*7477dbb9SJürgen Schmidt   goto :error
84985d02c7SAriel Constenla-Haile )
85985d02c7SAriel Constenla-Haile
86cdf0e10cSrcweirREM Set library path.
87*7477dbb9SJürgen Schmidt@set "LIB=%OO_SDK_HOME%\lib;%LIB%"
88cdf0e10cSrcweirif defined CPP_WINDOWS_SDK (
89*7477dbb9SJürgen Schmidt   @set "LIB=%LIB%;%CPP_WINDOWS_SDK%\lib"
90cdf0e10cSrcweir )
91cdf0e10cSrcweir
92cdf0e10cSrcweirREM Set office program path.
93cdf0e10cSrcweirif defined OFFICE_HOME (
94*7477dbb9SJürgen Schmidt   @set "OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program"
95cdf0e10cSrcweir )
96cdf0e10cSrcweirREM Set UNO path, necessary to ensure that the cpp examples using the
97cdf0e10cSrcweirREM new UNO bootstrap mechanism use the configured office installation
98cdf0e10cSrcweirREM (only set when using an Office).
99cdf0e10cSrcweirif defined OFFICE_HOME (
100*7477dbb9SJürgen Schmidt   @set "UNO_PATH=%OFFICE_PROGRAM_PATH%"
101*7477dbb9SJürgen Schmidt )
102cdf0e10cSrcweir
103b3ba5bc7SJürgen Schmidt
104*7477dbb9SJürgen Schmidt@set "OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%"
105*7477dbb9SJürgen Schmidt@set "OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH%"
106*7477dbb9SJürgen Schmidt@set "OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes"
107cdf0e10cSrcweir
108cdf0e10cSrcweirREM Set classpath
109*7477dbb9SJürgen Schmidt@set "CLASSPATH=%OO_SDK_OFFICE_JAVA_DIR%\juh.jar;%OO_SDK_OFFICE_JAVA_DIR%\jurt.jar;%OO_SDK_OFFICE_JAVA_DIR%\ridl.jar;%OO_SDK_OFFICE_JAVA_DIR%\unoloader.jar;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar"
110cdf0e10cSrcweir
111cdf0e10cSrcweirREM Add directory of the SDK tools to the path.
112*7477dbb9SJürgen Schmidtset "PATH=%OO_SDK_HOME%\bin;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\WINexample.out\bin;%OO_SDK_MAKE_HOME%;%OO_SDK_ZIP_HOME%;%OO_SDK_CAT_HOME%;%OO_SDK_SED_HOME%;%PATH%"
113cdf0e10cSrcweir
114*7477dbb9SJürgen SchmidtREM Set PATH appropriate to the output directory
115cdf0e10cSrcweirif defined OO_SDK_OUT (
116*7477dbb9SJürgen Schmidt   @set "PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH%"
117*7477dbb9SJürgen Schmidt ) else (
118*7477dbb9SJürgen Schmidt   @set "PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH%"
119*7477dbb9SJürgen Schmidt )
120b3ba5bc7SJürgen Schmidt
121b3ba5bc7SJürgen SchmidtREM Add directory of the Win SDK to the path, if necessary.
122b3ba5bc7SJürgen Schmidtif defined CPP_WINDOWS_SDK (
123*7477dbb9SJürgen Schmidt   @set "PATH=%CPP_WINDOWS_SDK\bin%;%PATH%"
124*7477dbb9SJürgen Schmidt   @set "INCLUDE=%CPP_WINDOWS_SDK\Include%;%INCLUDE%"
125b3ba5bc7SJürgen Schmidt)
126cdf0e10cSrcweirREM Add directory of the C# and VB.NET compilers to the path, if necessary.
127*7477dbb9SJürgen Schmidtif defined OO_SDK_CLI_HOME @set "PATH=%OO_SDK_CLI_HOME%;%PATH%"
128cdf0e10cSrcweir
129cdf0e10cSrcweirREM Add directory of the Java tools to the path, if necessary.
130*7477dbb9SJürgen Schmidtif defined OO_SDK_JAVA_HOME @set "PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH%"
131cdf0e10cSrcweir
132cdf0e10cSrcweirREM Set environment for C++ compiler tools, if necessary.
133cdf0e10cSrcweirif defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat"
134cdf0e10cSrcweir
135cdf0e10cSrcweirREM Set tilte to identify the prepared shell.
136cdf0e10cSrcweirtitle Shell prepared for SDK
137cdf0e10cSrcweir
138cdf0e10cSrcweirREM Prepare shell with all necessary environment variables.
139cdf0e10cSrcweirecho.
140cdf0e10cSrcweirecho  ******************************************************************
141cdf0e10cSrcweirecho  *
142cdf0e10cSrcweirecho  * SDK environment is prepared for Windows
143cdf0e10cSrcweirecho  *
144cdf0e10cSrcweirecho  * SDK = %OO_SDK_HOME%
145cdf0e10cSrcweirecho  * Office = %OFFICE_HOME%
146cdf0e10cSrcweirecho  * Make = %OO_SDK_MAKE_HOME%
147cdf0e10cSrcweirecho  * Zip = %OO_SDK_ZIP_HOME%
148985d02c7SAriel Constenla-Haileecho  * cat = %OO_SDK_CAT_HOME%
149985d02c7SAriel Constenla-Haileecho  * sed = %OO_SDK_SED_HOME%
150cdf0e10cSrcweirecho  * C++ Compiler = %OO_SDK_CPP_HOME%
151cdf0e10cSrcweirecho  * C# and VB.NET compilers = %OO_SDK_CLI_HOME%
152cdf0e10cSrcweirecho  * Java = %OO_SDK_JAVA_HOME%
153cdf0e10cSrcweirecho  * Special Output directory = %OO_SDK_OUT%
154cdf0e10cSrcweirecho  * Auto deployment = %SDK_AUTO_DEPLOYMENT%
155cdf0e10cSrcweirecho  *
156cdf0e10cSrcweirecho  ******************************************************************
157cdf0e10cSrcweirecho.
158*7477dbb9SJürgen Schmidtgoto end
159cdf0e10cSrcweir
160*7477dbb9SJürgen Schmidt :error
161cdf0e10cSrcweirError: Please insert the necessary environment variables into the batch file.
162cdf0e10cSrcweir
163*7477dbb9SJürgen Schmidt :end
164