Sfoglia il codice sorgente

fix: 脚本安装问题

sansan 6 mesi fa
parent
commit
e04459f33e
2 ha cambiato i file con 26 aggiunte e 22 eliminazioni
  1. 2 1
      readme.md
  2. 24 21
      setup-windows-en.bat

+ 2 - 1
readme.md

@@ -47,7 +47,7 @@
 - 感谢**关注[公众号](#问题答疑与1元点赞)** 的读者们,你们的留言、点赞、分享和推荐等积极互动让内容更有温度😎。  
 
 <details>
-<summary>👉 点击查看<strong>致谢名单</strong> (当前 <strong>🔥44🔥</strong> 位)</summary>
+<summary>👉 点击查看<strong>致谢名单</strong> (当前 <strong>🔥45🔥</strong> 位)</summary>
 
 ### 数据支持
 
@@ -67,6 +67,7 @@
 
 |           点赞人            |  金额  |  日期  |             备注             |
 | :-------------------------: | :----: | :----: | :-----------------------: |
+|           Q*Q          |  6.66  | 2025.11.07  |   感谢开源!     | 
 |           C*e          |  1  | 2025.11.05  |        | 
 |           Peter Fan          |  20  | 2025.10.29  |        | 
 |           M*n          |  1  | 2025.10.27  |      感谢开源  | 

+ 24 - 21
setup-windows-en.bat

@@ -1,17 +1,19 @@
 @echo off
-chcp 65001 >nul
+:: 使用系统默认编码而不是强制 UTF-8
 setlocal enabledelayedexpansion
+
 echo ==========================================
 echo   TrendRadar MCP Setup (Windows)
 echo ==========================================
-echo.
+echo:
 
 REM Get current directory
 set "PROJECT_ROOT=%CD%"
 echo Project Directory: %PROJECT_ROOT%
-echo.
+echo:
 
 REM Check Python
+echo Checking Python...
 python --version >nul 2>&1
 if %errorlevel% neq 0 (
     echo [ERROR] Python not detected. Please install Python 3.10+
@@ -19,19 +21,22 @@ if %errorlevel% neq 0 (
     pause
     exit /b 1
 )
+echo Python OK
+echo:
 
 REM Check UV
+echo Checking UV...
 where uv >nul 2>&1
 if %errorlevel% neq 0 (
     echo [1/3] UV not installed, installing automatically...
-    echo.
+    echo:
     
     REM Use Bypass execution policy
     powershell -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
     
     if %errorlevel% neq 0 (
         echo [ERROR] UV installation failed
-        echo.
+        echo:
         echo Please install UV manually:
         echo   Method 1: Visit https://docs.astral.sh/uv/getting-started/installation/
         echo   Method 2: Use pip install uv
@@ -39,30 +44,30 @@ if %errorlevel% neq 0 (
         exit /b 1
     )
     
-    echo.
+    echo:
     echo [SUCCESS] UV installed successfully
     echo [IMPORTANT] Please follow these steps:
     echo   1. Close this window
-    echo   2. Reopen Command Prompt (or PowerShell)
+    echo   2. Reopen Command Prompt or PowerShell
     echo   3. Navigate to project directory: cd "%PROJECT_ROOT%"
     echo   4. Run this script again: setup-windows.bat
-    echo.
+    echo:
     pause
     exit /b 0
 ) else (
     echo [1/3] UV already installed
     uv --version
 )
+echo:
 
-echo.
 echo [2/3] Installing project dependencies...
-echo.
+echo:
 
 REM Install dependencies with UV
 uv sync
 if %errorlevel% neq 0 (
     echo [ERROR] Dependency installation failed
-    echo.
+    echo:
     echo Possible causes:
     echo   - Missing pyproject.toml file
     echo   - Network connection issues
@@ -70,37 +75,35 @@ if %errorlevel% neq 0 (
     pause
     exit /b 1
 )
+echo:
 
-echo.
 echo [3/3] Checking configuration file...
-
 if not exist "config\config.yaml" (
     echo [WARNING] Configuration file not found: config\config.yaml
     if exist "config\config.example.yaml" (
         echo Tip: Example config found, please copy and modify:
         echo   copy config\config.example.yaml config\config.yaml
     )
-    echo.
+    echo:
 )
 
 REM Get UV path
 for /f "tokens=*" %%i in ('where uv 2^>nul') do set "UV_PATH=%%i"
-
 if not defined UV_PATH (
     echo [WARNING] Unable to get UV path, please find it manually
     set "UV_PATH=uv"
 )
 
-echo.
+echo:
 echo ==========================================
 echo   Setup Complete!
 echo ==========================================
-echo.
+echo:
 echo MCP Server Configuration:
-echo.
+echo:
 echo   Command: %UV_PATH%
 echo   Working Directory: %PROJECT_ROOT%
-echo.
+echo:
 echo   Arguments (one per line):
 echo     --directory
 echo     %PROJECT_ROOT%
@@ -108,7 +111,7 @@ echo     run
 echo     python
 echo     -m
 echo     mcp_server.server
-echo.
+echo:
 echo Documentation: README-Cherry-Studio.md
-echo.
+echo:
 pause