@echo off
rem Resolve the PHP 8.5.12 binary for NH POS development (Windows/WAMP).
rem Override with:  set NH_POS_PHP=C:\path\to\php.exe
rem Falls back to the verified WAMP 8.5.12 build, then the newest 8.5.x under WAMP.
if not "%NH_POS_PHP%"=="" (
  set "PHPBIN=%NH_POS_PHP%"
  goto :done
)
set "PHPBIN=C:\wamp64\bin\php\php8.5.12.1\php.exe"
if exist "%PHPBIN%" goto :done
for /f "delims=" %%D in ('dir /b /ad /o-n "C:\wamp64\bin\php\php8.5.*" 2^>nul') do (
  if exist "C:\wamp64\bin\php\%%D\php.exe" (
    set "PHPBIN=C:\wamp64\bin\php\%%D\php.exe"
    goto :done
  )
)
:done
if not exist "%PHPBIN%" (
  echo [NH POS] PHP 8.5 binary not found at "%PHPBIN%". Set NH_POS_PHP to the correct php.exe.>&2
  exit /b 1
)
