@ECHO OFF

CD .\EMS
CALL .\scripts\jenv2.bat 2>NUL
IF "%javaVersion%" == "" (
    GOTO ERROR	
)
IF "%javaHome%" == "" (
    GOTO ERROR
)

ECHO.
ECHO Check java environment...
ECHO Java version... %javaVersion%.
ECHO Java JRE path... %javaHome%.
ECHO.

START javaw -classpath .\lib\EMS.jar com.ctcu.nms.setup.UpgradeTool -lang EN
GOTO END

:ERROR
    ECHO.
    ECHO Java JRE not found! Please check if JAVA is installed?
    ECHO.
    PAUSE
    
:END
    