82603b3c2b
2008/06/25 11:06:48 cn 1.2.8.1: #i91008# enhance possible parameter
157 lines
5 KiB
Text
Executable file
157 lines
5 KiB
Text
Executable file
@echo off
|
|
REM **************************************************************************
|
|
REM * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
REM *
|
|
REM * Copyright 2008 by Sun Microsystems, Inc.
|
|
REM *
|
|
REM * OpenOffice.org - a multi-platform office productivity suite
|
|
REM *
|
|
REM * $RCSfile: cwscheckapi.btm,v $
|
|
REM *
|
|
REM * $Revision: 1.3 $
|
|
REM *
|
|
REM * This file is part of OpenOffice.org.
|
|
REM *
|
|
REM * OpenOffice.org is free software: you can redistribute it and/or modify
|
|
REM * it under the terms of the GNU Lesser General Public License version 3
|
|
REM * only, as published by the Free Software Foundation.
|
|
REM *
|
|
REM * OpenOffice.org is distributed in the hope that it will be useful,
|
|
REM * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
REM * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
REM * GNU Lesser General Public License version 3 for more details
|
|
REM * (a copy is included in the LICENSE file that accompanied this code).
|
|
REM *
|
|
REM * You should have received a copy of the GNU Lesser General Public License
|
|
REM * version 3 along with OpenOffice.org. If not, see
|
|
REM * <http://www.openoffice.org/license.html>
|
|
REM * for a copy of the LGPLv3 License.
|
|
REM ************************************************************************/
|
|
|
|
echo off
|
|
|
|
SET DEBIG_I=false
|
|
SET DEBUG_T=false
|
|
SET INSTALL=true
|
|
SET ATTACH=true
|
|
SET MODULES=auto
|
|
SET OOO=false
|
|
|
|
for %opt in (%&%) DO (
|
|
if "%opt%" == "-d" (SET DEBUG_I=true ^ SET DEBUG_T=true ^ shift)
|
|
if "%opt%" == "-o" (SET OOO=true ^ shift)
|
|
if "%opt%" == "-i" (SET DEBUG_I=true ^ shift)
|
|
if "%opt%" == "-m" (SET MODULES=%2 ^ shift ^ shift)
|
|
if "%opt%" == "-t" (SET DEBUG_T=true ^ shift)
|
|
if "%opt%" == "-s" (SET INSTALL=false ^ shift)
|
|
if "%opt%" == "-a" (SET attach=false ^ shift)
|
|
if "%opt%" == "-h" goto usage
|
|
if "%opt%" == "/h" goto usage
|
|
)
|
|
|
|
SET OFFICEDESTPATH=%tmp%\%USERNAME%\cwscheckapi
|
|
SET LOCALINSTALLDIR=%OFFICEDESTPATH%\office
|
|
SET LOCALUNPACKDIR=%OFFICEDESTPATH%\unpack
|
|
|
|
iff "%INSTALL%" == "true" THEN
|
|
call perl5 %SOLARENV%/bin/installoffice.pl -cwscheckapi true -dest %LOCALINSTALLDIR% -ooo %OOO% -debug %DEBUG_I%
|
|
|
|
IFF %? NE 0 THEN
|
|
echo ERROR: coud not install office
|
|
quit %?
|
|
ENDIFF
|
|
ENDIFF
|
|
|
|
setlocal
|
|
|
|
SET CWD=%_CWD%
|
|
cdd %LOCALINSTALLDIR%
|
|
SET ffindtxt="ffind.txt"
|
|
ffind /s /f /m soffice.exe > %ffindtxt
|
|
SET FindFile=%@FILEOPEN[%ffindtxt%, READ]
|
|
SET OfficeBin=%@FILEREAD[%FindFile]
|
|
set dummy=%@FILECLOSE[%FindFile]
|
|
DEL /q %ffindtxt
|
|
cdd %CWD
|
|
|
|
IFF NOT EXIST %OFFICEBIN% THEN
|
|
echo "could not find 'soffice.exe' in subfolders of %OFFICEBIN%"
|
|
quit 1
|
|
ENDIFF
|
|
|
|
SET JARFOLDER=%SOLARVERSION%\%INPATH%\bin%UPDMINOREXT%
|
|
SET MYCLASSPATH=%JARFOLDER%\OOoRunner.jar;%JARFOLDER%\ridl.jar;%JARFOLDER%\unoil.jar;%JARFOLDER%\jurt.jar;%JARFOLDER%\juh.jar;%JARFOLDER%\java_uno.jar
|
|
|
|
IFF "%JAVAI%" != "" THEN
|
|
SET JAVABIN=%JAVAI%
|
|
ELSEIFF "%JAVA_HOME%" != "" THEN
|
|
SET JAVABIN=%JAVA_HOME%\bin\java
|
|
ELSE
|
|
echo please set environment variable JAVA_HOME
|
|
quit 1
|
|
ENDIFF
|
|
|
|
IFF "%CWS_WORK_STAMP%" != "" THEN
|
|
SET PARAM=-Version cws_%CWS_WORK_STAMP%
|
|
ELSEIFF "%WORK_STAMP%" != "" THEN
|
|
echo ######
|
|
echo CAUTION! You\'re working on the MWS
|
|
echo ######
|
|
SET PARAM=-Version %WORK_STAMP%_%UPDMINOR%
|
|
ELSE
|
|
echo ######
|
|
echo ERROR: could not determine your CWS or MWS version
|
|
echo ######
|
|
quit 1
|
|
ENDIFF
|
|
|
|
SET KILLCOMMAND="%SOLARVERSION%\%INPATH%\bin%UPDMINOREXT%\kill.exe -9 soffice.bin"
|
|
|
|
SET PARAM=%PARAM% -cmd '\"%OFFICEBIN%\" -nofirststartwizard -norestore -nocrashreport -nolockcheck -accept=pipe,name=%USERNAME%;urp;'
|
|
SET PARAM=%PARAM% -cs pipe,name=%USERNAME%
|
|
SET PARAM=%PARAM% -NoOffice true
|
|
SET PARAM=%PARAM% -OOO_EnvSet setsolar
|
|
SET PARAM=%PARAM% -SRC_ROOT %SRC_ROOT%
|
|
SET PARAM=%PARAM% -COMP_ENV %INPATH%
|
|
SET PARAM=%PARAM% -Shell %COMSPEC%
|
|
SET PARAM=%PARAM% -tb java_complex
|
|
SET PARAM=%PARAM% -o complex.unoapi.CheckModuleAPI::module(%MODULES%)
|
|
SET PARAM=%PARAM% -TimeOut 200000
|
|
SET PARAM=%PARAM% -AppKillCommand %KILLCOMMAND%
|
|
IF "%ATTACH%" == "false" SET PARAM=%PARAM% -nca true
|
|
IF "%DEBUG_T%" == "true" SET PARAM=%PARAM -debug true -log true
|
|
|
|
set COMMANDO=%JAVABIN% -Xmx120m -cp %MYCLASSPATH% org.openoffice.Runner %PARAM% %&
|
|
|
|
echo %COMMANDO
|
|
SET LOGFILE=%OFFICEDESTPATH%\cwscheckapi.log
|
|
%COMMANDO |& tee %LOGFILE%
|
|
|
|
echo .
|
|
echo A logfile could be found here: %LOGFILE%
|
|
|
|
endlocal
|
|
|
|
quit 0
|
|
|
|
:usage
|
|
echo.
|
|
echo Usage: %0% [-m MODULE1[,MODULEn]] [-o] [-h] [-d] [-i] [-t] [-s] [-a] >&2
|
|
echo.
|
|
echo [-m] list of modules to test like: '-m "sw,sc,sd"' or '-m all' for all modules >&2
|
|
echo. >&2
|
|
echo [-o] force OpenOffice.org installation instead of StarOffice >&2
|
|
echo. >&2
|
|
echo [-d] debug installation and UnoAPI-Tests >&2
|
|
echo. >&2
|
|
echo [-i] debug installation >&2
|
|
echo. >&2
|
|
echo [-t] debug UnoAPI-Tests >&2
|
|
echo. >&2
|
|
echo [-s] skip installation of Office >&2
|
|
echo. >&2
|
|
echo [-a] NoCwsAttach: do not attach UnoAPI-Test result to EIS database >&2
|
|
echo. >&2
|
|
echo further informations: http://wiki.services.openoffice.org/wiki/Cwscheckapi >&2
|
|
echo. >&2
|
|
quit 1
|