Skip to content

fix: PyInstaller 启动器缺少 --icon 参数导致图标丢失#66

Closed
Watanabehato wants to merge 10 commits into
1bananachicken:mainfrom
Watanabehato:fix/launcher-icon
Closed

fix: PyInstaller 启动器缺少 --icon 参数导致图标丢失#66
Watanabehato wants to merge 10 commits into
1bananachicken:mainfrom
Watanabehato:fix/launcher-icon

Conversation

@Watanabehato

Copy link
Copy Markdown
Collaborator

Summary

  • PyInstaller 编译 MaaNTE.exe 时未指定 --icon 参数,导致生成的启动器 exe 没有嵌入应用图标
  • 添加 --icon 参数指向 install/logo.ico(CI 流程中已由 ImageMagick 生成)

问题原因

引入 PyInstaller 启动器后,MaaNTE.exe 从 rcedit 嵌入图标的 MFAAvalonia 变成了 PyInstaller 编译的新 exe,但 PyInstaller 命令遗漏了 --icon 参数。

Test plan

  • CI 构建后检查 MaaNTE.exe 是否显示正确的应用图标

🤖 Generated with Claude Code

Watanabehato and others added 10 commits May 1, 2026 11:03
- 将 warning.md 内容内联到 interface.json welcome 字段,防止通过删除文件绕过警告
- 在 agent/main.py 添加 _verify_warning_integrity(),启动时校验 welcome 字段 SHA256 哈希
- 校验失败时输出醒目防售卖警告日志

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 使用 Windows MessageBoxTimeoutW API 弹出独立窗口
- 5秒自动关闭,置顶显示
- 通过 config/warning_shown.json 记录已显示状态
- 降级方案:若 TimeoutW 不可用则使用普通 MessageBox

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 新增 launcher.py:使用 Windows MessageBox 弹出警告窗口,5秒自动关闭
- 新增 create_launcher.py:CI 构建时创建 MaaNTE.bat 启动器
- MaaNTE.exe 重命名为 MaaNTE_core.exe,MaaNTE.bat 作为入口
- 首次弹窗状态记录在 config/warning_shown.json

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 新增 launcher_standalone.py:PyInstaller 编译为独立 MaaNTE.exe
- MaaNTE.exe(MFAAvalonia)重命名为 MaaNTE_core.exe
- 启动器显示首次使用警告弹窗(5秒自动关闭),然后启动 MaaNTE_core.exe
- CI 流程自动安装 PyInstaller 并编译启动器
- 移除 agent/main.py 中的弹窗调用(由启动器处理)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
agent 日志可能未被 MFAAvalonia 捕获,改为弹出 MessageBox 确保可见

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 每次启动时校验 interface.json welcome 字段哈希
- 校验失败弹出错误对话框,阻止正常使用
- 解决 agent 仅在执行任务时启动导致校验不触发的问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
已被 PyInstaller 方案 (launcher_standalone.py) 替代

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CI 环境默认 cp1252 编码,添加 stdout/stderr utf-8 重配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
script_dir.parent.parent 指向了仓库根目录的上一级,
导致 CI 中找不到 MaaNTE.exe。改为 script_dir.parent。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PyInstaller 编译 MaaNTE.exe 时未指定 --icon,生成的 exe 没有嵌入图标。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant