mirror of
https://github.com/WT810787899/YuChuan.git
synced 2026-12-05 16:01:48 +00:00
- windows/CMakeLists.txt: BINARY_NAME rust_flutter_ui -> YuChuan (CMake 的 target 名不支持非 ASCII,写「雨传」会直接报 Cannot specify compile definitions for target 雨传 which is not built, 所以构建名用 ASCII,发布时由 package_release.ps1 改名为「雨传.exe」) - windows/runner/CMakeLists.txt: 加 /utf-8 —— main.cpp 是无 BOM 的 UTF-8, 不指定的话 MSVC 按系统代码页(GBK)读,中文字面量会变乱码 - windows/runner/main.cpp: 原生窗口标题 YuChuan -> 雨传 YuChuan - windows/runner/Runner.rc: 版本资源补齐/修正 FileDescription -> 雨传 YuChuan - 局域网聊天 / 传文件工具 ProductName/InternalName/OriginalFilename -> 雨传 LegalCopyright 去掉模板残留的 com.example - scripts: 同步 exe 名;新增 package_release.ps1(便携版 zip + 安卓包) 说明:图标是编译期嵌进二进制的,改图标必须重新构建(本机无 rcedit/ ResourceHacker 之类可直接改 exe 资源的工具)。
24 lines
981 B
PowerShell
24 lines
981 B
PowerShell
# 构建 Windows Release(cargokit 会自动 cargo build --release)
|
||
# 用法: .\scripts\build_windows.ps1
|
||
# PS 5.1 下 native 命令写 stderr 会被 $ErrorActionPreference='Stop' 当成终止错误
|
||
# (flutter/cargo 都会写 stderr),改为 Continue + 逐条检查 $LASTEXITCODE。
|
||
$ErrorActionPreference = 'Continue'
|
||
$root = Split-Path $PSScriptRoot -Parent
|
||
Set-Location $root
|
||
|
||
$env:PATH = "C:\flutter\bin;C:\Users\81078\.cargo\bin;" + $env:PATH
|
||
$env:PUB_HOSTED_URL = 'https://pub.flutter-io.cn'
|
||
$env:FLUTTER_STORAGE_BASE_URL = 'https://storage.flutter-io.cn'
|
||
|
||
& dart analyze lib
|
||
if ($LASTEXITCODE -ne 0) { throw 'dart analyze failed' }
|
||
|
||
# 运行中的实例会锁死 exe(LNK1104),先关掉
|
||
Get-Process rust_flutter_ui -ErrorAction SilentlyContinue | ForEach-Object { $_.Kill() }
|
||
Start-Sleep -Seconds 1
|
||
|
||
& flutter build windows
|
||
if ($LASTEXITCODE -ne 0) { throw 'flutter build windows failed' }
|
||
|
||
Write-Host "OK: $root\build\windows\x64\runner\Release\雨传.exe"
|