@echo off

if exist "%~dp0barcontrol-windows.jar" ( java.exe -Xmx128m -enableassertions -cp "%~dp0barcontrol-windows.jar" DataModel )
if exist "%~dp0barcontrol-windows_64.jar" ( java.exe -Xmx128m -enableassertions -cp "%~dp0barcontrol-windows_64.jar" DataModel )
if errorlevel 64 goto 64
if errorlevel 32 goto 32
goto error

:64
  java.exe -Xmx128m -enableassertions -jar "%~dp0barcontrol-windows_64.jar" %*
goto end

:32
  java.exe -Xmx128m -enableassertions -jar "%~dp0barcontrol-windows.jar" %*
goto end

:error
  echo ERROR: cannot detect data model (32/64 bit) - VM failure?
  pause
goto end

:end
@echo on
