setup-windows-en.bat 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. @echo off
  2. chcp 65001 >nul
  3. setlocal enabledelayedexpansion
  4. echo ==========================================
  5. echo TrendRadar MCP Setup (Windows)
  6. echo ==========================================
  7. echo.
  8. REM Get current directory
  9. set "PROJECT_ROOT=%CD%"
  10. echo Project Directory: %PROJECT_ROOT%
  11. echo.
  12. REM Check Python
  13. python --version >nul 2>&1
  14. if %errorlevel% neq 0 (
  15. echo [ERROR] Python not detected. Please install Python 3.10+
  16. echo Download: https://www.python.org/downloads/
  17. pause
  18. exit /b 1
  19. )
  20. REM Check UV
  21. where uv >nul 2>&1
  22. if %errorlevel% neq 0 (
  23. echo [1/3] UV not installed, installing automatically...
  24. echo.
  25. REM Use Bypass execution policy
  26. powershell -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
  27. if %errorlevel% neq 0 (
  28. echo [ERROR] UV installation failed
  29. echo.
  30. echo Please install UV manually:
  31. echo Method 1: Visit https://docs.astral.sh/uv/getting-started/installation/
  32. echo Method 2: Use pip install uv
  33. pause
  34. exit /b 1
  35. )
  36. echo.
  37. echo [SUCCESS] UV installed successfully
  38. echo [IMPORTANT] Please follow these steps:
  39. echo 1. Close this window
  40. echo 2. Reopen Command Prompt (or PowerShell)
  41. echo 3. Navigate to project directory: cd "%PROJECT_ROOT%"
  42. echo 4. Run this script again: setup-windows.bat
  43. echo.
  44. pause
  45. exit /b 0
  46. ) else (
  47. echo [1/3] UV already installed
  48. uv --version
  49. )
  50. echo.
  51. echo [2/3] Installing project dependencies...
  52. echo.
  53. REM Install dependencies with UV
  54. uv sync
  55. if %errorlevel% neq 0 (
  56. echo [ERROR] Dependency installation failed
  57. echo.
  58. echo Possible causes:
  59. echo - Missing pyproject.toml file
  60. echo - Network connection issues
  61. echo - Incompatible Python version
  62. pause
  63. exit /b 1
  64. )
  65. echo.
  66. echo [3/3] Checking configuration file...
  67. if not exist "config\config.yaml" (
  68. echo [WARNING] Configuration file not found: config\config.yaml
  69. if exist "config\config.example.yaml" (
  70. echo Tip: Example config found, please copy and modify:
  71. echo copy config\config.example.yaml config\config.yaml
  72. )
  73. echo.
  74. )
  75. REM Get UV path
  76. for /f "tokens=*" %%i in ('where uv 2^>nul') do set "UV_PATH=%%i"
  77. if not defined UV_PATH (
  78. echo [WARNING] Unable to get UV path, please find it manually
  79. set "UV_PATH=uv"
  80. )
  81. echo.
  82. echo ==========================================
  83. echo Setup Complete!
  84. echo ==========================================
  85. echo.
  86. echo MCP Server Configuration:
  87. echo.
  88. echo Command: %UV_PATH%
  89. echo Working Directory: %PROJECT_ROOT%
  90. echo.
  91. echo Arguments (one per line):
  92. echo --directory
  93. echo %PROJECT_ROOT%
  94. echo run
  95. echo python
  96. echo -m
  97. echo mcp_server.server
  98. echo.
  99. echo Documentation: README-Cherry-Studio.md
  100. echo.
  101. pause