@echo off
title AURA STUDIO - 8085 Microprocessor Simulator
setlocal EnableDelayedExpansion

set JAVA_EXE=java

set CP=dist\AuraSimulator.jar
for %%f in (lib\*.jar) do set CP=!CP!;%%f

set JFX_PATH=%~dp0javafx-sdk\lib
if not exist "!JFX_PATH!" (
    set JFX_PATH=%~dp0lib
)
if not exist "!JFX_PATH!\javafx.controls.jar" (
    set JFX_PATH=C:\Program Files\Java\javafx-sdk-17.0.19\lib
)
if not exist "!JFX_PATH!" (
    for /d %%d in ("C:\Program Files\Java\javafx-sdk*") do set JFX_PATH=%%d\lib
)

if exist "!JFX_PATH!" (
    "!JAVA_EXE!" -cp "!CP!" --module-path "!JFX_PATH!" --add-modules javafx.controls,javafx.media,javafx.swing,javafx.graphics SplashScreen
) else (
    "!JAVA_EXE!" -cp "!CP!" SplashScreen
)

endlocal
