Repository navigation
Conversation
仅当 DeskBox.exe 位于本地 git 克隆内(向上找到同时含 .git 与 scripts/fork-dev-update.ps1 的仓库根)时启用,正式安装版完全不受影响。 - Directory.Build.targets:Debug 构建时 git rev-parse,把提交 sha/分支写入 AssemblyMetadata(ForkGitSha/ForkGitBranch);取不到时运行时读 .git。 - 启动后及每 30 分钟匿名请求 GitHub commits/dev,比较远端最新 sha, 有新提交时发更新通知(沿用现有更新提示样式,点击打开 关于)。 - 设置「关于→更新详情」显示「本地测试版:当前 <短sha>,有新提交 …」与 「更新并重启」按钮;点「检查更新」时同时检查该通道。 - 「更新并重启」以独立可见窗口运行 fork-dev-update.ps1 后退出 DeskBox; 脚本新增 -GraceSeconds(先等 DeskBox 自行退出),失败时 Read-Host 暂停。 - 新增 ForkDevUpdateTests:仓库根探测、sha 比较、正式安装版不启用等。
GOXF
added a commit
that referenced
this pull request
Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
本地开发构建(DeskBox.exe 位于含
.git与scripts/fork-dev-update.ps1的克隆内)启用「本地测试版更新通道」;正式安装版完全不受影响(探测不到仓库根即全部关闭)。Directory.Build.targets在 Debug 构建时执行git rev-parse,写入AssemblyMetadata(ForkGitSha/ForkGitBranch)。git 不可用时不报错,运行时改读.git(HEAD → loose ref / packed-refs / worktree)。Release / CI / 安装包构建不执行(可用/p:ForkEmbedGitInfo=true强开)。GET https://api.github.com/repos/GOXF/DeskBox/commits/dev,失败静默。有新提交时发更新通知(沿用现有更新 toast,托盘气泡兜底;遵循「显示更新通知」开关;同一提交只提示一次),点击打开 设置→关于。powershell -ExecutionPolicy Bypass -File <repo>\scripts\fork-dev-update.ps1 -Branch dev -GraceSeconds 15,再走现有ShutdownForUpdateAsync退出 DeskBox。-GraceSeconds(先等 DeskBox 自行退出再强制结束);git fetch/checkout 检查退出码;任何失败时窗口暂停(Read-Host)。文件
新增:
Services/ForkDevBuildInfo.cs、Services/ForkDevUpdateService.cs、ViewModels/SettingsViewModel.ForkDevUpdate.cs、Views/SettingsWindow.ForkDevUpdate.cs、App.ForkDevUpdate.cs、tests/.../ForkDevUpdateTests.cs改动(最小):
App.xaml.cs+1 行、SettingsViewModel.AboutAndUpdates.cs+1 行、SettingsWindow.xaml+17 行、Directory.Build.targets、scripts/fork-dev-update.ps1测试
ForkDevUpdateTests:仓库根探测(嵌套 bin、worktree .git 文件、缺 .git / 缺脚本)、正式安装目录不启用、.git 读 sha(loose / packed / detached)、sha 比较、commits API 解析、网络失败静默、脚本启动参数。