@echo off
setlocal

set "ROOT_DIR=%~dp0.."
set "JAR_PATH=%ROOT_DIR%\dist\Saleculator.jar"

if not exist "%JAR_PATH%" (
    echo Missing %JAR_PATH%. This runtime package is incomplete; reinstall or replace it with a validated package.
    exit /b 1
)

pushd "%ROOT_DIR%" >nul
java -Ddirname.path="%ROOT_DIR%" -cp "%ROOT_DIR%\lib\*;%JAR_PATH%" com.posics.pos.forms.StartPOS %*
set "RESULT=%ERRORLEVEL%"
popd >nul
exit /b %RESULT%
