@echo off
REM Install NodeJS Keyence listener as Windows service using NSSM
REM Adjust paths before running!

set SVC_NAME=KeyenceTCPListener
set NODE_EXE="C:\Program Files\nodejs\node.exe"
set APP_DIR=C:\xampp\htdocs\smproduce\keyence_service
set APP_JS=%APP_DIR%\server.js

nssm install %SVC_NAME% %NODE_EXE% "%APP_JS%"
nssm set %SVC_NAME% AppDirectory %APP_DIR%
nssm set %SVC_NAME% Start SERVICE_AUTO_START

echo Service %SVC_NAME% installed. Open services.msc to verify.
pause
