@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem      https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  bootloader startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and BOOTLOADER_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\lib\jgnash-fx-3.5.1.jar;%APP_HOME%\lib\jgnash-convert-3.5.1.jar;%APP_HOME%\lib\jgnash-report-core-3.5.1.jar;%APP_HOME%\lib\jgnash-core-3.5.1.jar;%APP_HOME%\lib\jgnash-plugin-3.5.1.jar;%APP_HOME%\lib\jgnash-resources-3.5.1.jar;%APP_HOME%\lib\picocli-4.1.4.jar;%APP_HOME%\lib\commons-lang3-3.9.jar;%APP_HOME%\lib\poi-ooxml-4.1.2.jar;%APP_HOME%\lib\poi-4.1.2.jar;%APP_HOME%\lib\commons-math3-3.6.1.jar;%APP_HOME%\lib\javafx-web-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-web-14-ea+8-win.jar;%APP_HOME%\lib\javafx-web-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-fxml-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-fxml-14-ea+8-win.jar;%APP_HOME%\lib\javafx-fxml-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-controls-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-controls-14-ea+8-win.jar;%APP_HOME%\lib\javafx-controls-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-controls-14-ea+8.jar;%APP_HOME%\lib\javafx-swing-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-swing-14-ea+8-win.jar;%APP_HOME%\lib\javafx-swing-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-media-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-media-14-ea+8-win.jar;%APP_HOME%\lib\javafx-media-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-media-14-ea+8.jar;%APP_HOME%\lib\javafx-graphics-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-graphics-14-ea+8-win.jar;%APP_HOME%\lib\javafx-graphics-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-graphics-14-ea+8.jar;%APP_HOME%\lib\javafx-base-14-ea+8-linux.jar;%APP_HOME%\lib\javafx-base-14-ea+8-win.jar;%APP_HOME%\lib\javafx-base-14-ea+8-mac.jar;%APP_HOME%\lib\javafx-base-14-ea+8.jar;%APP_HOME%\lib\hibernate-entitymanager-5.4.12.Final.jar;%APP_HOME%\lib\slf4j-jdk14-1.8.0-beta4.jar;%APP_HOME%\lib\hibernate-hikaricp-5.4.12.Final.jar;%APP_HOME%\lib\HikariCP-3.4.2.jar;%APP_HOME%\lib\slf4j-api-1.8.0-beta4.jar;%APP_HOME%\lib\h2-1.4.200.jar;%APP_HOME%\lib\hsqldb-2.4.1.jar;%APP_HOME%\lib\xstream-hibernate-1.4.11.1.jar;%APP_HOME%\lib\xstream-1.4.11.1.jar;%APP_HOME%\lib\netty-codec-4.1.45.Final.jar;%APP_HOME%\lib\commons-collections4-4.4.jar;%APP_HOME%\lib\commons-csv-1.8.jar;%APP_HOME%\lib\jgnash-bayes-3.5.1.jar;%APP_HOME%\lib\pdfbox-tools-2.0.18.jar;%APP_HOME%\lib\pdfbox-debugger-2.0.18.jar;%APP_HOME%\lib\pdfbox-2.0.18.jar;%APP_HOME%\lib\hibernate-core-5.4.12.Final.jar;%APP_HOME%\lib\hibernate-commons-annotations-5.1.0.Final.jar;%APP_HOME%\lib\jboss-logging-3.3.2.Final.jar;%APP_HOME%\lib\dom4j-2.1.1.jar;%APP_HOME%\lib\javax.persistence-api-2.2.jar;%APP_HOME%\lib\byte-buddy-1.10.7.jar;%APP_HOME%\lib\jboss-transaction-api_1.2_spec-1.1.1.Final.jar;%APP_HOME%\lib\netty-transport-4.1.45.Final.jar;%APP_HOME%\lib\netty-buffer-4.1.45.Final.jar;%APP_HOME%\lib\netty-resolver-4.1.45.Final.jar;%APP_HOME%\lib\netty-common-4.1.45.Final.jar;%APP_HOME%\lib\poi-ooxml-schemas-4.1.2.jar;%APP_HOME%\lib\commons-compress-1.19.jar;%APP_HOME%\lib\curvesapi-1.06.jar;%APP_HOME%\lib\fontbox-2.0.18.jar;%APP_HOME%\lib\commons-logging-1.2.jar;%APP_HOME%\lib\javassist-3.24.0-GA.jar;%APP_HOME%\lib\antlr-2.7.7.jar;%APP_HOME%\lib\jandex-2.1.1.Final.jar;%APP_HOME%\lib\classmate-1.5.1.jar;%APP_HOME%\lib\jaxb-runtime-2.3.1.jar;%APP_HOME%\lib\jaxb-api-2.3.1.jar;%APP_HOME%\lib\javax.activation-api-1.2.0.jar;%APP_HOME%\lib\commons-codec-1.13.jar;%APP_HOME%\lib\SparseBitSet-1.2.jar;%APP_HOME%\lib\xmlbeans-3.1.0.jar;%APP_HOME%\lib\txw2-2.3.1.jar;%APP_HOME%\lib\istack-commons-runtime-3.0.7.jar;%APP_HOME%\lib\stax-ex-1.8.jar;%APP_HOME%\lib\FastInfoset-1.2.15.jar

@rem Execute bootloader
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %BOOTLOADER_OPTS%  -classpath "%CLASSPATH%" jgnash.app.jGnash %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable BOOTLOADER_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%BOOTLOADER_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
