@echo off
setlocal

set pfwHome=%~dp0

set jars=%pfwHome%\tagsoup.jar

if exist "%pfwHome%\paste_from_word.jar" goto jar
echo paste_from_word.jar not found
exit /B 2

:jar
set cp=%pfwHome%\paste_from_word.jar;%jars%

rem --------------------------------------------------------------------------
rem MODIFY VARIABLE BELOW IF NEEDED TO!
rem
rem Variable xxeHome must point to the directory when XMLmind XML Editor 
rem has been installed. 
rem Example: set xxeHome=C:\Program Files\XMLmind_XML_Editor
rem --------------------------------------------------------------------------

set xxeHome=%pfwHome%\..\..

if exist "%xxeHome%\bin\xxe.jar" goto xxejar
if exist "%pfwHome%\..\..\11xxe\class" goto xxeclass
echo xxe.jar not found; please edit this script to set variable xxeHome
exit /B 3

:xxeclass
set xxeHome=%pfwHome%\..\..\11xxe
set xxeCode=%xxeHome%\class
goto fi

:xxejar
set xxeCode=%xxeHome%\bin\xxe.jar
:fi

set cp=%xxeCode%;%xxeHome%\bin\xmlresolver.jar;%xxeHome%\bin\saxon.jar;%cp%
echo %cp%

if exist "%xxeHome%\jre\bin\java.exe" goto privatejre
set java=java
goto fi2

:privatejre
set java=%xxeHome%\jre\bin\java.exe
:fi2

"%java%" -classpath "%cp%" com.xmlmind.xmleditext.paste_from_word.engine.Engine %*
