@echo off
setlocal
set "PS=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe"
if not exist "%PS%" set "PS=powershell.exe"
set "LOGDIR=%LOCALAPPDATA%\LiveRushDataCollector\logs"
if not exist "%LOGDIR%" mkdir "%LOGDIR%" >nul 2>nul
start "" "%PS%" -NoProfile -STA -ExecutionPolicy Bypass -WindowStyle Hidden -File "%~dp0wait-open-data-collector.ps1"
if errorlevel 1 (
  echo Failed to start hidden launcher. >> "%LOGDIR%\launcher.cmd.log"
  "%PS%" -NoProfile -STA -ExecutionPolicy Bypass -File "%~dp0wait-open-data-collector.ps1"
)
