Skip to content

修复普通开机自启未写入注册表#101

Merged
Akiha-Official merged 1 commit into
DoomVoss:mainfrom
kudiaotaibai:codex/fix-autostart-registry
May 2, 2026
Merged

修复普通开机自启未写入注册表#101
Akiha-Official merged 1 commit into
DoomVoss:mainfrom
kudiaotaibai:codex/fix-autostart-registry

Conversation

@kudiaotaibai
Copy link
Copy Markdown
Contributor

Summary

修复控制面板中普通开机自启不会正确写入 Windows Run 注册表项的问题,并补充回归测试。

Problem

当前保存“开机自动启动”设置时,代码只处理高权限自启使用的计划任务。用户只勾选普通自启、不启用管理员权限时,旧的计划任务会被删除,但没有重新写入 HKCU\Software\Microsoft\Windows\CurrentVersion\Run,导致普通自启可能不生效。

Changes

  • 抽出 AutoStartManager管理自启模式决策、启动命令和 exe 路径解析。
  • 普通自启写入 Run注册表项。
  • 高权限自启继续使用计划任务。
  • 优先使用 .exe路径,避免单文件/发布场景下误用程序集 .dll路径。
  • 新增 xUnit 回归测试。
  • PR CI 增加 dotnet test。

Validation

  • dotnet test E:\issue\BASpark\BASpark.sln -c Release --verbosity minimal
    • Passed: 5/5
  • dotnet build E:\issue\BASpark\BASpark.sln -c Release
    • 0 warnings
    • 0 errors

@DoomVoss DoomVoss requested a review from Akiha-Official May 2, 2026 12:03
@Akiha-Official Akiha-Official merged commit 78aa6f0 into DoomVoss:main May 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants