@echo off
title Install Claude Proxy Control
REM ASCII only, on purpose. cmd.exe reads a .bat in the console codepage, and
REM UTF-8 Cyrillic here gets parsed as commands - the launcher died with
REM "'E' is not recognized as an internal or external command" on exactly that.
REM All Russian text belongs to the PowerShell scripts, which handle it fine.
REM
REM This file only starts the launcher and passes its exit code on. It used to
REM print "Done. Launch the shortcut" no matter what happened - the install
REM could fail halfway and the user still read that the shortcut was created.
setlocal
if not exist "%~dp0runtime\Install-Launcher.ps1" goto :nofiles
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0runtime\Install-Launcher.ps1"
set RC=%ERRORLEVEL%
if not "%RC%"=="0" goto :failed
exit /b 0

:nofiles
echo.
echo ERROR: runtime\Install-Launcher.ps1 is missing next to this file.
echo Unpack the WHOLE archive into a folder first, then run Install.bat there.
echo Running it straight from the zip viewer does not work.
echo Current folder: %~dp0
echo.
pause
exit /b 1

:failed
echo.
echo Install did not finish. See the message above and %TEMP%\cpc-install.log
echo.
pause
exit /b %RC%
