2 REM **************************************************************************
3 REM * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 REM * Copyright 2008 by Sun Microsystems, Inc.
7 REM * OpenOffice.org - a multi-platform office productivity suite
9 REM * $RCSfile: cwscheckapi.btm,v $
11 REM * $Revision: 1.3.6.4 $
13 REM * This file is part of OpenOffice.org.
15 REM * OpenOffice.org is free software: you can redistribute it and/or modify
16 REM * it under the terms of the GNU Lesser General Public License version 3
17 REM * only, as published by the Free Software Foundation.
19 REM * OpenOffice.org is distributed in the hope that it will be useful,
20 REM * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 REM * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 REM * GNU Lesser General Public License version 3 for more details
23 REM * (a copy is included in the LICENSE file that accompanied this code).
25 REM * You should have received a copy of the GNU Lesser General Public License
26 REM * version 3 along with OpenOffice.org. If not, see
27 REM * <http://www.openoffice.org/license.html>
28 REM * for a copy of the LGPLv3 License.
29 REM ************************************************************************/
33 call reportErrorCheckAPI.btm 0 running
35 iff "%PROEXT" != ".pro" THEN
36 echo ERROR: cwscheckapi works only on pro-versions >&2
37 call reportErrorCheckAPI.btm 2
48 SET USE_INSTALLED_OFFICE=false
50 for %opt in (%&%) DO (
51 if "%opt%" == "-d" (SET DEBUG_I=true ^ SET DEBUG_T=true ^ shift)
52 if "%opt%" == "-o" (SET OOO=true ^ shift)
53 if "%opt%" == "-k" (SET KEEPOFFICE=true ^ shift)
54 if "%opt%" == "-i" (SET DEBUG_I=true ^ shift)
55 if "%opt%" == "-m" (SET MODULES=%2 ^ shift ^ shift)
56 if "%opt%" == "-t" (SET DEBUG_T=true ^ shift)
57 if "%opt%" == "-s" (SET INSTALL=false ^ shift)
58 if "%opt%" == "-u" (SET USE_INSTALLED_OFFICE=true ^ SET INSTALL=false ^ SET KEEPOFFICE=true ^ shift)
59 if "%opt%" == "-a" (SET attach=false ^ shift)
60 if "%opt%" == "-h" goto usage
61 if "%opt%" == "/h" goto usage
65 for %LW in (e:\,d:\,c:\) DO (
66 iff NOT ISDIR %tmppath% then
68 iff ISDIR %LW%temp then
70 elseiff ISDIR %LW%tmp then
80 SET CWSCHECKAPIPATH=%tmppath%\%USERNAME%\cwscheckapi
81 SET LOCALINSTALLDIR=%CWSCHECKAPIPATH%\office
82 SET LOCALUNPACKDIR=%CWSCHECKAPIPATH%\unpack
84 iff "%INSTALL%" == "true" THEN
85 call perl5 %SOLARENV%/bin/installoffice.pl -cwscheckapi true -dest %LOCALINSTALLDIR% -ooo %OOO% -debug %DEBUG_I%
88 echo ERROR: coud not install office >&2
89 call reportErrorCheckAPI.btm 2
96 IFF %USE_INSTALLED_OFFICE% == "false" then
100 SET ffindtxt="ffind.txt"
101 ffind /s /f /m soffice.exe > %ffindtxt
102 SET FindFile=%@FILEOPEN[%ffindtxt%, READ]
103 SET OfficeBin=%@FILEREAD[%FindFile]
104 set dummy=%@FILECLOSE[%FindFile]
108 IFF NOT EXIST %OFFICEBIN% THEN
109 echo could not find 'soffice.exe' in subfolders of %OFFICEBIN% >&2
110 call reportErrorCheckAPI.btm 2
114 SET OFFICEBIN=soffice.exe
115 echo "Use already installed office."
118 SET JARFOLDER=%SOLARVERSION%\%INPATH%\bin%UPDMINOREXT%
119 SET MYCLASSPATH=%JARFOLDER%\OOoRunner.jar;%JARFOLDER%\ridl.jar;%JARFOLDER%\unoil.jar;%JARFOLDER%\jurt.jar;%JARFOLDER%\juh.jar;%JARFOLDER%\java_uno.jar
121 IFF "%JAVAI%" != "" THEN
123 ELSEIFF "%JAVA_HOME%" != "" THEN
124 SET JAVABIN=%JAVA_HOME%\bin\java
126 echo please set environment variable JAVA_HOME >&2
127 call reportErrorCheckAPI.btm 2
131 IFF "%CWS_WORK_STAMP%" != "" THEN
132 SET PARAM=-Version cws_%CWS_WORK_STAMP%
133 ELSEIFF "%WORK_STAMP%" != "" THEN
135 echo CAUTION! You\'re working on the MWS >&2
137 SET PARAM=-Version %WORK_STAMP%_%UPDMINOR%
140 echo ERROR: could not determine your CWS or MWS version >&2
142 call reportErrorCheckAPI.btm 2
146 SET KILLCOMMAND="%SOLARVERSION%\%INPATH%\bin%UPDMINOREXT%\kill.exe -9 soffice.bin^%SOLARVERSION%\%INPATH%\bin%UPDMINOREXT%\kill.exe -9 soffice.exe"
148 SET PARAM=%PARAM% -cmd '\"%OFFICEBIN%\" -nofirststartwizard -norestore -nocrashreport -nolockcheck -enableautomation -accept=pipe,name=%USERNAME%;urp;'
149 SET PARAM=%PARAM% -cs pipe,name=%USERNAME%
150 SET PARAM=%PARAM% -NoOffice true
151 SET PARAM=%PARAM% -SRC_ROOT %SRC_ROOT%
152 SET PARAM=%PARAM% -COMP_ENV %OUTPATH%
153 SET PARAM=%PARAM% -Shell %COMSPEC%
154 SET PARAM=%PARAM% -tb java_complex
155 SET PARAM=%PARAM% -o complex.unoapi.CheckModuleAPI::module(%MODULES%)
156 SET PARAM=%PARAM% -TimeOut 200000
157 SET PARAM=%PARAM% -AppKillCommand %KILLCOMMAND%
158 IF "%ATTACH%" == "false" SET PARAM=%PARAM% -nca true
159 IF "%DEBUG_T%" == "true" SET PARAM=%PARAM -debug true -log true
161 set COMMANDO=%JAVABIN% -Xmx120m -cp %MYCLASSPATH% org.openoffice.Runner %PARAM% %&
164 SET LOGFILE=%CWSCHECKAPIPATH%\cwscheckapi.log
165 %COMMANDO |& tee %LOGFILE%
168 IFF %KEEPOFFICE% == "false" THEN
169 echo remove office instrallation in %LOCALINSTALLDIR%...
170 DEL /E/F/Q/K/S/X/Y/Z %LOCALINSTALLDIR%
174 echo A logfile could be found here: %LOGFILE%
176 IFF %EXITVAL% NE 0 THEN
177 call reportErrorCheckAPI.btm 1
179 call reportErrorCheckAPI.btm 0 ok
188 echo Usage: %0% [-m MODULE1[,MODULEn]] [-o] [-k] [-h] [-d] [-i] [-t] [-s] [-a] >&2
190 echo [-m] list of modules to test like: '-m "sw,sc,sd"' or '-m all' for all modules >&2
192 echo [-o] force OpenOffice.org installation instead of StarOffice >&2
194 echo [-k] keep Office installation, otherwise it will be removed after test >&2
196 echo [-d] debug installation and UnoAPI-Tests >&2
198 echo [-i] debug installation >&2
200 echo [-t] debug UnoAPI-Tests >&2
202 echo [-s] skip installation of Office >&2
204 echo [-a] NoCwsAttach: do not attach UnoAPI-Test result to EIS database >&2
206 echo further informations: http://wiki.services.openoffice.org/wiki/Cwscheckapi >&2