Skip to content

feat(installer): 分离 CLI/TUI 快捷方式 AUMID,安装时放行 Windows 防火墙 - #361

Merged
OrientCOMPASS merged 3 commits into
MicYou-Dev:masterfrom
OrientCOMPASS:master
Oct 6, 2026
Merged

OrientCOMPASS merged 3 commits into
MicYou-Dev:masterfrom
OrientCOMPASS:master

Conversation

@OrientCOMPASS

Copy link
Copy Markdown
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 入站放行规则;重复安装先删后加
  避免规则重复;卸载时无条件清理这三条规则。
@micyou-automation micyou-automation Bot added waitmerge 等待合并 size/m 30-99 行 labels Oct 4, 2026
@OrientCOMPASS

Copy link
Copy Markdown
Contributor Author

安装时给出了防火墙选项
image
image

上一版 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 工作流验证通过。
@micyou-automation micyou-automation Bot added reviewing 正在复核 size/l 100-499 行 and removed waitmerge 等待合并 size/m 30-99 行 labels Oct 4, 2026
实机反馈:仅当前用户模式收尾的 ShellExec('runas') UAC 提权执行不稳定、总是失败。
按维护者决定回退:
- firewall 任务恢复 Check: IsAdminInstallMode(非管理员模式不显示)
- 移除提权批处理/标记文件/失败提示等第二轮机制,[Code] 回到第一版实现
- 新增 [Messages] 覆盖:安装模式选择对话框中'为所有用户安装(推荐)'选项
  及说明文字标注'自动配置防火墙',引导用户选择可获得防火墙配置的模式
  (中英文,覆盖 PrivilegesRequiredOverrideText1 / AllUsers / AllUsersRecommended)

已在 windows-latest 以静默安装→断言三条规则→静默卸载→断言无残留 的
E2E 工作流验证通过 (run 37257260255)。
@micyou-automation micyou-automation Bot added size/m 30-99 行 and removed size/l 100-499 行 labels Oct 5, 2026
@OrientCOMPASS
OrientCOMPASS merged commit 0c69fdd into MicYou-Dev:master Oct 6, 2026
4 checks passed
@micyou-automation micyou-automation Bot added done 完成 and removed reviewing 正在复核 labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

done 完成 size/m 30-99 行

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant