feat(windows): 增加原生服务安装包 - #493
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthrough本次变更新增 Windows 服务命令、服务运行时和停止流程。新增服务专用 ACL,覆盖目录和密钥文件。新增 Inno Setup 安装器、覆盖安装、卸载和健康检查流程。CI 和发布流程加入 Windows 安装包构建、校验和冒烟测试。英文、中文和日文文档补充了 Windows 安装器和数据目录说明。 Merge Risk: 🔵 Low · up to This PR adds Windows service installation and installer upgrade/rollback behavior. A failed service update or interrupted installation could leave partially restored service or installation state, so merge is reasonable with explicit owner awareness and follow-up on atomic recovery. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 1.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 104 functions across 23 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches✨ Simplify code
Warning Some tools did not complete. Review the errors below. 🔧 golangci-lint (2.12.2)Error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 845a3f09f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
main_test.go-59-64 (1)
59-64: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win移除对未安装服务状态的隐式假设。
在 Windows 主机已安装
gpt-load服务时,Line 57 的service status会返回0。Line 59 会使测试失败。此测试应按runtime.GOOS使用平台期望,或避免调用真实 SCM 状态查询。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: QUIET
Plan: Pro Plus
Run ID: 6daca098-580a-490a-8b5b-b9b054b2790b
📒 Files selected for processing (29)
.github/release-assets.txt.github/scripts/ci-windows-service-smoke.ps1.github/scripts/release-windows-installer-smoke.ps1.github/workflows/ci.yml.github/workflows/release.ymlREADME.mdREADME_CN.mdREADME_JP.mdinternal/platform/securefile/managed_windows.gointernal/platform/securefile/managed_windows_test.gointernal/platform/securefile/securefile_windows.gointernal/platform/securefile/securefile_windows_test.gointernal/platform/securefile/service_acl_windows.gointernal/platform/securefile/windows_acl_policy.gointernal/platform/securefile/windows_acl_policy_test.gointernal/webui/windows_installer_contract_test.gointernal/webui/workflow_test.gomain.gomain_test.gopackaging/windows/gpt-load.issruntime.goruntime_test.goservice_cli.goservice_cli_test.goservice_manager_windows.goservice_manager_windows_test.goservice_nonwindows.goservice_windows.goservice_windows_test.go
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c77849369e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packaging/windows/gpt-load.iss (1)
35-35: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win安装包编译失败:ChineseSimplified.isl 不随 Inno Setup 分发。
CI 报错显示编译器无法打开
C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl,退出码 2。简体中文属于非官方翻译,官方安装包只提供Default.isl与官方语言文件。上游 issue 讨论也给出同样结论:该文件不存在于 Inno Setup 6 的Languages目录,需要自行提供该文件不在Languages目录内,需作为变通方案加入仓库,编译日志显示 "Couldn't open include file",因为中文翻译尚非官方翻译。因此
build-windows-setup作业以及依赖它的package-checksums、publication-preflight门禁在任何干净 runner 上都会失败,gpt-load-windows-setup.exe无法产出。请选择一种修复方式:把
ChineseSimplified.isl随包放入packaging/windows/并改用相对路径引用;或在工作流中把该文件复制到 Inno Setup 的Languages目录后再编译。🔧 方案 A:随仓库提供语言文件
-Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" +Name: "chinesesimplified"; MessagesFile: "ChineseSimplified.isl"同时将
ChineseSimplified.isl(UTF-8 with BOM)添加到packaging/windows/目录。🔧 方案 B:在工作流中安装语言文件
# 在 .github/workflows/release.yml 与 ci.yml 的 ISCC 步骤之前执行 $languages = "C:\Program Files (x86)\Inno Setup 6\Languages" Invoke-WebRequest ` -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl" ` -OutFile (Join-Path $languages "ChineseSimplified.isl")Source: Pipeline failures
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: QUIET
Plan: Pro Plus
Run ID: 68de37db-77ad-40a9-8409-82f61b27e549
📒 Files selected for processing (14)
.github/scripts/ci-windows-service-smoke.ps1.github/scripts/release-windows-installer-smoke.ps1.github/workflows/ci.ymlinternal/webui/windows_installer_contract_test.gomain_test.gopackaging/windows/gpt-load.issservice_cli.goservice_cli_test.goservice_manager_windows.goservice_manager_windows_test.goservice_wait.goservice_wait_test.goservice_windows.goservice_windows_test.go
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1113ae978
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12ddfeec61
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FreshInstallCleanupEligible := | ||
| (not DirExists(ExpandConstant('{app}'))) and | ||
| (not RegKeyExists(HKLM64, WindowsUninstallKey)); |
There was a problem hiding this comment.
Clean up failed reinstalls with an existing app directory
When reinstalling after an uninstall or earlier failure left {app} behind but no binary, service, or uninstall registration, this condition disables fresh-install cleanup solely because the directory exists. If service installation or startup then fails, RestorePreviousInstallation has nothing to restore and skips CleanupFailedFreshInstallation, leaving the newly copied executable, uninstaller, shortcuts, and uninstall key despite Setup returning exit code 10. The fresh evidence after the prior report is that the newly added cleanup remains gated by not DirExists('{app}'); track and remove artifacts created by this run while preserving pre-existing contents.
Useful? React with 👍 / 👎.
关联 Issue / Related Issue
无 / None
变更内容 / Change Content
gpt-load-windows-amd64.exe便携前台运行方式,新增gpt-load-windows-setup.exe安装包产物。%ProgramData%\GPT-Load\data。NT SERVICE\gpt-load与 Administrators 访问。兼容性:无数据迁移;现有便携 Windows EXE 的无参数前台运行行为和产物名称保持不变。
验证:
make checkgo vet、二进制构建及 Windows 测试二进制编译actionlint v1.7.12git diff --check未验证范围:本地非 Windows 环境未执行真实 SCM/UAC/Inno 安装流程;已加入
windows-2025PR/Release CI 门禁,远端结果待运行。自查清单 / Checklist
make check,或在说明中写明无法运行的原因和未验证范围。 / I ranmake check, or documented why it could not run and what remains unverified.Summary by CodeRabbit
新功能
安全性
文档