1@echo off
2rem *************************************************************
3rem
4rem  Licensed to the Apache Software Foundation (ASF) under one
5rem  or more contributor license agreements.  See the NOTICE file
6rem  distributed with this work for additional information
7rem  regarding copyright ownership.  The ASF licenses this file
8rem  to you under the Apache License, Version 2.0 (the
9rem  "License")rem you may not use this file except in compliance
10rem  with the License.  You may obtain a copy of the License at
11rem
12rem    http://www.apache.org/licenses/LICENSE-2.0
13rem
14rem  Unless required by applicable law or agreed to in writing,
15rem  software distributed under the License is distributed on an
16rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17rem  KIND, either express or implied.  See the License for the
18rem  specific language governing permissions and limitations
19rem  under the License.
20rem
21rem *************************************************************
22REM This script sets all enviroment variables, which
23REM are necessary for building the examples of the Office Development Kit.
24REM The Script was developed for the operating systems Windows.
25REM The SDK name
26REM Example: set OO_SDK_NAME=openoffice3.0_sdk
27set OO_SDK_NAME=openoffice.org3.0_sdk
28
29REM Installation directory of the Software Development Kit.
30REM Example: set OO_SDK_HOME=C:\Program Files\OpenOffice.org\Basic 3.0\sdk
31set OO_SDK_HOME=
32
33REM Office installation directory.
34REM Example: set OFFICE_HOME=C:\Program Files\OpenOffice.org 3
35set OFFICE_HOME=
36
37REM Example: set OFFICE_HOME=C:\Program Files\OpenOffice.org\Basis 3.0
38set OFFICE_BASE_HOME=
39
40REM URE installation directory.
41REM Example: set OO_SDK_URE_HOME=C:\Program Files\OpenOffice.org\URE
42set OO_SDK_URE_HOME=
43
44REM Directory of the make command.
45REM Example: set OO_SDK_MAKE_HOME=D:\NextGenerationMake\make
46set OO_SDK_MAKE_HOME=
47
48REM Directory of the zip tool.
49REM Example: set OO_SDK_ZIP_HOME=D:\infozip\bin
50set OO_SDK_ZIP_HOME=
51
52REM Directory of the C++ compiler.
53REM Example:set OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
54REM Example:set CPP_WINDOWS_SDK=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\
55set OO_SDK_CPP_HOME=
56set CPP_VC8=
57set CPP_WINDOWS_SDK=
58
59REM Directory of the C# and VB.NET compilers.
60REM Example:set OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705
61set OO_SDK_CLI_HOME=
62
63REM Java SDK installation directory.
64REM Example: set OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05
65set OO_SDK_JAVA_HOME=
66
67REM Special output directory
68REM Example: set OO_SDK_OUT=C:\openoffice.org3.0_sdk
69set OO_SDK_OUT=
70
71REM Automatic deployment
72REM Example: set SDK_AUTO_DEPLOYMENT=YES
73set SDK_AUTO_DEPLOYMENT=YES
74
75set STLDEBUG=
76REM check stlport lib in 4NT shell
77REM if exist "%OO_SDK_HOME%\windows\lib\stlport_vc71_stldebug.lib". (
78REM   set STLDEBUG=_stldebug
79REM )
80
81REM Check installation path for the StarOffice Development Kit.
82if not defined OO_SDK_HOME (
83   echo Error: the variable OO_SDK_HOME is missing!
84   goto :error
85 )
86
87REM Check installation path for the office.
88REM if not defined OFFICE_HOME (
89REM if not defined OO_SDK_URE_HOME (
90REM    echo Error: either of the variables OFFICE_HOME and
91REM    echo OO_SDK_URE_HOME is missing!
92REM    goto :error
93REM  )
94REM  )
95
96REM Check installation path for GNU make.
97if not defined OO_SDK_MAKE_HOME (
98   echo Error: the variable OO_SDK_MAKE_HOME is missing!
99   goto :error
100 )
101
102REM Check installation path for the zip tool.
103if not defined OO_SDK_ZIP_HOME (
104   echo Error: the variable OO_SDK_ZIP_HOME is missing!
105   goto :error
106 )
107
108REM Set library path.
109set LIB=%OO_SDK_HOME%\lib;%LIB%
110if defined CPP_WINDOWS_SDK (
111   set LIB=%LIB%;%CPP_WINDOWS_SDK%\lib
112 )
113
114REM Set office program path.
115if defined OFFICE_HOME (
116   set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program
117 )
118
119REM Set office program path.
120if defined OFFICE_BASE_HOME (
121   set OFFICE_BASE_PROGRAM_PATH=%OFFICE_BASE_HOME%\program
122 )
123
124REM Set UNO path, necessary to ensure that the cpp examples using the
125REM new UNO bootstrap mechanism use the configured office installation
126REM (only set when using an Office).
127if defined OFFICE_HOME (
128   set UNO_PATH=%OFFICE_PROGRAM_PATH%
129 )
130
131REM if defined OO_SDK_URE_HOME (
132set OO_SDK_URE_BIN_DIR=%OO_SDK_URE_HOME%\bin
133set OO_SDK_URE_LIB_DIR=%OO_SDK_URE_HOME%\bin
134set OO_SDK_URE_JAVA_DIR=%OO_SDK_URE_HOME%\java
135REM ) else (
136set OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%
137set OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH%
138set OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes
139REM )
140
141REM Set classpath
142set 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
143REM if defined OFFICE_HOME (
144REM     set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar
145REM  )
146
147REM Add directory of the SDK tools to the path.
148set PATH=%OO_SDK_HOME%\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\WINexample.out\bin;%PATH%
149
150REM Set PATH appropriate to the output directory
151if defined OO_SDK_OUT (
152   set PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH%
153 ) else (
154   set PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH%
155 )
156
157REM Add directory of the command make to the path, if necessary.
158if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%
159
160REM Add directory of the zip tool to the path, if necessary.
161if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%
162
163REM Add directory of the C++ compiler to the path, if necessary.
164if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%
165
166REM Add directory of the C# and VB.NET compilers to the path, if necessary.
167if defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH%
168
169REM Add directory of the Java tools to the path, if necessary.
170if defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH%
171
172REM Set environment for C++ compiler tools, if necessary.
173if defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat"
174
175REM Set tilte to identify the prepared shell.
176title Shell prepared for SDK
177
178REM Prepare shell with all necessary environment variables.
179echo.
180echo  ******************************************************************
181echo  *
182echo  * SDK environment is prepared for Windows
183echo  *
184echo  * SDK = %OO_SDK_HOME%
185echo  * Office = %OFFICE_HOME%
186echo  * Office Base = %OFFICE_BASE_HOME%
187echo  * URE = %OO_SDK_URE_HOME%
188echo  * Make = %OO_SDK_MAKE_HOME%
189echo  * Zip = %OO_SDK_ZIP_HOME%
190echo  * C++ Compiler = %OO_SDK_CPP_HOME%
191echo  * C# and VB.NET compilers = %OO_SDK_CLI_HOME%
192echo  * Java = %OO_SDK_JAVA_HOME%
193echo  * Special Output directory = %OO_SDK_OUT%
194echo  * Auto deployment = %SDK_AUTO_DEPLOYMENT%
195echo  *
196echo  ******************************************************************
197echo.
198goto end
199
200 :error
201Error: Please insert the necessary environment variables into the batch file.
202
203 :end
204