@ECHO OFF
CD /D %~DP0

SET CLASSPATH=lib\EMS.jar;lib\mssql-jdbc-6.4.0.jre7.jar
SET cmd=jre\bin\javaw com.ctcu.nms.setup.SetupFrame

IF "%ProgramFiles(x86)%" == "" (
    ECHO.    
    ECHO EMS is not supported on 32-bit platform.
    ECHO.
    PAUSE
) ELSE (    
    ECHO.
    ECHO EMS installation... 
    IF EXIST scripts\jenv.bat (
        REM launched after EMS installed.
        START %cmd%
    ) ELSE (
        REM launched when CD installing. block the window until bat exits then CD installer reads installed property.
        %cmd% -lang EN
        icacls "%cd%" /grant users:"(CI)(OI)F" >NUL
    )
)



