@echo off
rem  Testwell CTC++
rem  ctc2html batch file for CTC++ to HTML converter invoking
rem
rem  Copyright (c) Verifysoft Technology GmbH
rem

if "%CTCHOME%" == "" goto NoCTCHOME
set "CTC_PERL_DIR=%CTCHOME%\perl\bin"
if not exist "%CTC_PERL_DIR%\perl.exe" goto NoPERL

rem prepend PATH (so that exactly "our" PerlGlob.exe comes into use!)
set OLDPATH=%PATH%
set PATH="%CTC_PERL_DIR%";%PATH%

rem Do the actual perl run...
"%CTC_PERL_DIR%\perl" "%CTCHOME%\ctc2html.pl" %*

set PATH=%OLDPATH%
set OLDPATH=
goto END

:NoCTCHOME
echo.
echo The environment variable CTCHOME does not exist. Set CTCHOME
echo to point to the CTC++ installation directory.
echo.
goto END

:NoPERL
echo.
echo CTC++ installation directory %CTCHOME%
echo does not contain perl subdirectory or it does not contain perl.exe.
echo.
goto end

:END
