hi-client/install_flutter.bat
shanshanzhong 701acd561a
Some checks failed
Build Windows / ACT Windows Checkout Verification (push) Failing after 7h0m20s
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 19m50s
Build Windows / build (push) Failing after 7h0m28s
ci(workflow): 更新 Flutter 版本至 3.24.3 并添加回退检查
添加 Windows 平台 Flutter 安装脚本,支持版本 3.35.5
2025-11-07 09:46:37 -08:00

41 lines
1.1 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
REM 安装 Flutter SDK on Windows
REM 设置安装目录
set FLUTTER_DIR=C:\flutter
REM 检查是否已安装 Flutter
where flutter >nul 2>nul
if %errorlevel% == 0 (
echo Flutter 已安装,正在检查版本...
flutter --version
goto :end
)
REM 如果未安装,下载 Flutter SDK
echo 下载 Flutter SDK...
powershell -Command "Invoke-WebRequest -Uri 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.35.5-stable.zip' -OutFile 'flutter.zip'"
REM 创建目录
if not exist "%FLUTTER_DIR%" mkdir "%FLUTTER_DIR%"
REM 解压
echo 解压 Flutter SDK 到 %FLUTTER_DIR%...
powershell -Command "Expand-Archive -Path 'flutter.zip' -DestinationPath '%FLUTTER_DIR%' -Force"
REM 添加到 PATH临时
set PATH=%FLUTTER_DIR%\flutter\bin;%PATH%
REM 永久添加 PATH需要管理员权限
echo 请手动将 %FLUTTER_DIR%\flutter\bin 添加到系统 PATH 环境变量。
echo 或者运行以下命令作为管理员:
echo setx /M PATH "%PATH%;%FLUTTER_DIR%\flutter\bin"
REM 运行 flutter doctor
flutter doctor
REM 清理
del flutter.zip
:end
pause