@echo off
setlocal

set "SCRIPT_DIR=%~dp0"
set "PS_SCRIPT=%SCRIPT_DIR%scripts\build_windows_oneclick.ps1"

if not exist "%PS_SCRIPT%" (
  echo Script PowerShell introuvable : %PS_SCRIPT%
  pause
  exit /b 1
)

echo Lancement du build Windows one-click...
powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%PS_SCRIPT%"
set "EXITCODE=%ERRORLEVEL%"

if not "%EXITCODE%"=="0" (
  echo.
  echo Le build a echoue. Code retour : %EXITCODE%
  pause
  exit /b %EXITCODE%
)

echo.
echo Build termine avec succes.
pause
exit /b 0
