@echo off
setlocal
cd /d "%~dp0"
title ComputePool Worker Installer
echo.
echo Installing ComputePool Worker...
echo.
if not exist "%~dp0dist\ComputePool-Worker.exe" (
  where node >nul 2>nul
  if errorlevel 1 (
  echo Node.js LTS is required before installing ComputePool Worker.
  echo Please install Node.js LTS from https://nodejs.org/ and run this file again.
  echo.
  pause
  exit /b 1
  )
)
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0install-worker.ps1"
if errorlevel 1 (
  echo.
  echo Installation failed. Please close this window and try again.
  pause
  exit /b 1
)
echo.
echo Installation complete. You can return to the ComputePool AI website.
echo If this is the first time using local AI, run prepare-ai-model.cmd or click Prepare AI Model on the website.
pause
