Repository navigation
feat(installer): 分离 CLI/TUI 快捷方式 AUMID,安装时放行 Windows 防火墙 - #361
Merged
Merged
Conversation
OrientCOMPASS
commented
Oct 4, 2026
Contributor
- GUI/CLI/TUI 三个开始菜单快捷方式此前共用同一个 AppUserModelID (com.lanrhyme.micyou),导致 Windows 将三者折叠为同一身份(搜索结果/ 任务栏互相重叠)。现在 CLI 使用 com.lanrhyme.micyou.cli,TUI 使用 com.lanrhyme.micyou.tui,GUI 保持不变。
- 参考 qBittorrent 安装程序的防火墙组件:新增默认勾选的 firewall 任务 (仅管理员模式显示),安装时为 micyou.exe / micyou-cli.exe / micyou-tui.exe 添加 netsh advfirewall 入站放行规则;重复安装先删后加 避免规则重复;卸载时无条件清理这三条规则。
- GUI/CLI/TUI 三个开始菜单快捷方式此前共用同一个 AppUserModelID (com.lanrhyme.micyou),导致 Windows 将三者折叠为同一身份(搜索结果/ 任务栏互相重叠)。现在 CLI 使用 com.lanrhyme.micyou.cli,TUI 使用 com.lanrhyme.micyou.tui,GUI 保持不变。 - 参考 qBittorrent 安装程序的防火墙组件:新增默认勾选的 firewall 任务 (仅管理员模式显示),安装时为 micyou.exe / micyou-cli.exe / micyou-tui.exe 添加 netsh advfirewall 入站放行规则;重复安装先删后加 避免规则重复;卸载时无条件清理这三条规则。
Contributor
Author
上一版 firewall 任务带 Check: IsAdminInstallMode,非管理员模式下整条隐藏;
且 Inno 对已存在的同 AppId 安装会沿用原权限模式(重装不再询问),导致
'仅当前用户'用户完全看不到防火墙选项,可能无法正常使用(入站被拦)。
- 任务在所有安装模式下显示、默认勾选(同 qBittorrent 组件语义)
- 管理员模式:安装收尾直接 netsh 添加(先删后加,升级不重复);卸载无条件清理
- 仅当前用户模式:安装收尾通过 ShellExec('runas') 运行生成的 ASCII 批处理,
单次 UAC 提权完成全部 netsh 操作;安装目录以参数 %1 传入避免非 ASCII
路径被代码页破坏;静默安装跳过提权,避免无人值守卡在不可见弹窗
- {app}\.firewall-rules 标记文件记录规则已实际添加:在 usUninstall 阶段
(文件删除遍历前)读取并删除,避免残留文件导致 {app} 目录无法移除;
非管理员卸载仅在标记存在时发起提权删除,避免无谓 UAC
- 提权被取消/失败时给出中英双语说明(CustomMessages)
已在 windows-latest 上以静默安装→断言三条规则(含 Program 路径)→静默卸载→
断言规则/目录/注册表无残留 的 E2E 工作流验证通过。
实机反馈:仅当前用户模式收尾的 ShellExec('runas') UAC 提权执行不稳定、总是失败。
按维护者决定回退:
- firewall 任务恢复 Check: IsAdminInstallMode(非管理员模式不显示)
- 移除提权批处理/标记文件/失败提示等第二轮机制,[Code] 回到第一版实现
- 新增 [Messages] 覆盖:安装模式选择对话框中'为所有用户安装(推荐)'选项
及说明文字标注'自动配置防火墙',引导用户选择可获得防火墙配置的模式
(中英文,覆盖 PrivilegesRequiredOverrideText1 / AllUsers / AllUsersRecommended)
已在 windows-latest 以静默安装→断言三条规则→静默卸载→断言无残留 的
E2E 工作流验证通过 (run 37257260255)。
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.

