新增: 自动升级体系 + WorkerW重建检测 + 知识卡片优化
自动升级: - 版本变量注入 (-ldflags -X main.version) - 远程 version.json 检查 + 弹窗提示(非强制右下角/强制居中) - updater.exe 嵌入主程序, 运行时释放到临时目录 - 下载+SHA256校验+备份+替换+回滚 全流程 - 托盘菜单"检查更新" 稳定性: - WorkerW 重建自动检测(每10s)并重新嵌入 - 左键托盘点击防抖 - 设置窗口已打开时正确前置 优化: - 知识卡片prompt改为面向开发者的硬核内容 - 配置目录统一到 ~/.u-desktop/ - 设置窗口WebView2数据目录改为configDir下
This commit is contained in:
@@ -29,6 +29,15 @@ $gitHash = git rev-parse --short HEAD
|
||||
$version = "$(Get-Date -Format 'yyyyMMdd').$gitHash"
|
||||
Write-Host "=== 构建 $project v$version ===" -ForegroundColor Cyan
|
||||
|
||||
# 构建 updater.exe(先编译,主程序需要 embed)
|
||||
Write-Host "=== 构建 updater ===" -ForegroundColor Cyan
|
||||
Push-Location updater
|
||||
go build -ldflags="-s -w -H windowsgui" -o updater.exe .
|
||||
if ($LASTEXITCODE -ne 0) { Write-Host "updater 构建失败" -ForegroundColor Red; exit 1 }
|
||||
Pop-Location
|
||||
Copy-Item "updater/updater.exe" "updater.exe" -Force
|
||||
Write-Host "updater.exe 已复制到根目录" -ForegroundColor Green
|
||||
|
||||
# 构建(隐藏控制台窗口)
|
||||
$env:GOOS = "windows"
|
||||
$env:GOARCH = "amd64"
|
||||
|
||||
Reference in New Issue
Block a user