@echo off
REM Launcher script for Yaffaif/GameFX2.
REM
REM Checks java is installed.
REM Reports java version.
REM Leaves the command window open intentionally.
REM $Revision: 1.3 $

REM If you have other versions of Java installed, remove the REM statements
REM and edit the JAVA_HOME line to point to your Java 8 JDK or JRE.
REM
REM set JAVA_HOME=C:\Dev\jdk1.8.0_25
REM set PATH=%JAVA_HOME%\bin;%PATH%

set "MISSING_REQUIREMENTS=false"

CALL :check_requirement java Java https://java.com/

IF "%MISSING_REQUIREMENTS%"=="true" (
  pause
  exit /b
)

java -version
java -jar GameFX2.jar
pause
exit

REM Ensures that the system has a specific program installed on the PATH.
:check_requirement
set "MISSING_REQUIREMENT=true"
where %1 > NUL 2>&1 && set "MISSING_REQUIREMENT=false"

IF "%MISSING_REQUIREMENT%"=="true" (
  echo Download and install %2 from %3
  set "MISSING_REQUIREMENTS=true"
)

exit /b
