@echo off
rem Script: setup.cmd
rem Title:  Script start executable setup jar
rem Author: oliver.haufe@sos-berlin.com

set JAVAWBIN=javaw.exe
if exist "%JAVA_HOME%\bin\javaw.exe" set JAVAWBIN=%JAVA_HOME%\bin\javaw.exe
set JAVABIN=java.exe
if exist "%JAVA_HOME%\bin\java.exe" set JAVABIN=%JAVA_HOME%\bin\java.exe

set PARAM_XML_FILE=%~f1
if not defined PARAM_XML_FILE (
  start "JS7 JobScheduler Controller" "%JAVAWBIN%" -jar "%~dp0js7_controller_windows.2.7.4.1.jar"
) else (
  "%JAVABIN%" -jar "%~dp0js7_controller_windows.2.7.4.1.jar" "%PARAM_XML_FILE%"
)
exit /B %ERRORLEVEL%

