@echo off
cd /d "%~dp0"

REM ========================================================
REM   DeepSeek V4 Pro ˼ v2
REM ========================================================

REM  pythonw޿̨ڣ
where pythonw >nul 2>&1
if not errorlevel 1 goto USE_PYTHONW

REM pythonw ã˵ python
where python >nul 2>&1
if not errorlevel 1 goto USE_PYTHON

REM ûҵ
echo.
echo [] δ PATH ҵ Python
echo 밲װ Python 3.8 ߰汾
echo صַ: https://www.python.org/downloads/
echo װʱعѡ "Add Python to PATH"
echo.
pause
exit /b 1


:USE_PYTHONW
start "" pythonw "deepseek_tool.py"
timeout /t 2 /nobreak >nul

REM Ƿб־GUI ʧʱд
if exist "%USERPROFILE%\Desktop\deepseek_tool_crash.log" (
    echo.
    echo [⵽] Ϣ:
    echo ----------------------------------------
    type "%USERPROFILE%\Desktop\deepseek_tool_crash.log"
    echo ----------------------------------------
    del "%USERPROFILE%\Desktop\deepseek_tool_crash.log" 2>nul
    echo.
    echo  python Բ鿴ʵʱ...
    echo.
    goto USE_PYTHON
)
exit /b 0


:USE_PYTHON
echo ʹ python ̨رգ
python "deepseek_tool.py"
if errorlevel 1 (
    echo.
    echo 쳣˳, : %errorlevel%
    pause
)
exit /b 0
