@echo off
:: =====================================================================
::  SVERA DEFENSE — FIELD LAUNCHER bootstrap
::
::  Double-click this. It opens the launcher, which checks HQ for a new
::  field kit, installs or patches it, and starts the game.
::
::  Keep this file next to SveraDefenseLauncher.exe (or the .ps1 plus the
::  assets\ folder). The game installs into .\SveraDefense.
::
::  Prefers the compiled exe; falls back to the script when only the .ps1
::  shipped. The old console launcher is still here as SveraLauncher.ps1
::  if you ever want the no-GUI version.
:: =====================================================================
title Svera Defense - Field Launcher

if exist "%~dp0SveraDefenseLauncher.exe" (
  start "" "%~dp0SveraDefenseLauncher.exe" %*
  exit /b 0
)

if exist "%~dp0SveraDefenseLauncher.ps1" (
  powershell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -STA -File "%~dp0SveraDefenseLauncher.ps1" %*
  if errorlevel 1 (
    echo.
    echo The field launcher exited with an error. See launcher.log next to this file.
    pause
  )
  exit /b 0
)

echo.
echo Could not find SveraDefenseLauncher.exe or SveraDefenseLauncher.ps1 next to this file.
echo Unzip the whole launcher folder together and try again.
pause
