Skip to content

fix(windows): repair icons on legacy ChatGPT shortcuts - #460

Merged
Wangnov merged 5 commits into
Wangnov:mainfrom
2725238326:fix/legacy-shortcut-icon-repair
Oct 23, 2026
Merged

Wangnov merged 5 commits into
Wangnov:mainfrom
2725238326:fix/legacy-shortcut-icon-repair

Conversation

@2725238326

@2725238326 2725238326 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Portable launch repair handles Codex.lnk but skips legacy ChatGPT.lnk. A link to a root compatibility launcher can keep a blank icon or the launcher's fallback icon.

Include an existing ChatGPT.lnk when its target matches a known entry point of the current installation. Repair blank icons, launcher icon sources and missing known official icon sources; preserve other custom sources. Check and update the same loaded Shell link, changing only the icon path and index. Preserve the target, arguments, working directory, AppUserModelID, description and hotkey, and avoid rewriting correct links.

The repository-wide audit gate also rejects the locked ZIP and TLS versions covered by RustSec advisories. Update zip to 9.0.5, rustls to 0.23.46, rustls-webpki to 0.103.16 and webpki-root-certs to 1.0.10, and adapt the archive readers to ZIP 9. Decode entry names from their effective raw bytes and language flag: CP437 unless UTF-8 is declared, with valid UnicodePath extra fields respected. Theme import, MSIX extraction, version probing and macOS preflight share this decoder. Path and symlink validation use the same decoded name; malformed declared UTF-8 is rejected.

Disable the updater's optional ZIP installer handler to remove its separate zip 4.6.1 dependency. The latest stable updater still uses ZIP 4 for this handler. Current Windows releases use signed NSIS .exe files; TLS, system proxy support and macOS .app.tar.gz handling remain enabled. Legacy Windows ZIP update payloads are no longer supported.

Download tests verify rejection of file:// by the public HTTPS-only path and final progress reporting by the transfer runner using a local fixture. Tests sharing download state run serially. Production download arguments are unchanged.

Validation

  • Windows workspace tests: 463 passed, 17 existing ignored tests, including all 12 shortcut tests.
  • Workspace Clippy: all targets pass with warnings denied.
  • cargo audit: no vulnerabilities. cargo deny check: passes.

@Wangnov Wangnov left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图标修复和依赖升级方向已核对,当前 CI 通过。独立兼容复现发现 ZIP 9 对未设置 UTF-8 标志的合法 CP437 文件名改变了解码结果,会使主题资源和 MSIX BlockMap 失配;请补齐这项回归后再合并。

Comment thread crates/codex-theme-engine/src/import.rs Outdated
.by_index(index)
.map_err(|e| err(format!("读取压缩包条目失败: {e}")))?;
let entry_name = entry
.name()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 保留未设置 UTF-8 标志的 CP437 文件名语义。zip 9.0.5 的 name() 总是先按 UTF-8 解码,zip 8 则按 ZIP language flag 选择。有效 CP437 文件名原始字节 C3 A9 2E 77 65 62 70(flag 0、无 UnicodePath)原先是「├⌐.webp」,这里变为「é.webp」。已用真实 import_codexskin 入口复现:theme.json 引用 assets/├⌐.webp 时,导入报 asset unreadable;Windows 安装入口同样因 BlockMap 的 app\├⌐.bin 与解压名 app/é.bin 不一致而报 payload missing。新增 0x82 用例覆盖不到这种“同时是有效 UTF-8”的 CP437 序列。请依据 name_raw()+flags() 保留编码语义(并尊重有效 UnicodePath extra),且在同一解码结果上做路径验证;仅修显示名而继续调用 enclosed_name() 仍会走 ZIP 9 的另一套解码。请同时核对 portable.rs 与 mac_update.rs 的对应入口。

@Wangnov Wangnov left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复核 1252b9c:名称解码按 ZIP bit 11 区分 CP437/UTF-8,并保留有效 UnicodePath 的覆盖;路径校验与落盘使用同一解码结果。主题资源、MSIX BlockMap 和 macOS 包读取的回归用例已覆盖。本地归档/主题/Windows引擎测试及 Clippy、cargo audit 通过;当前提交12项CI全部通过。此前 CP437 兼容阻塞已解决。

@Wangnov
Wangnov merged commit 4f3fdf3 into Wangnov:main Oct 23, 2026
12 checks 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.

2 participants