Skip to content

自动检测 ChatGPT 等打包应用注册的右键菜单 - #311

Open
CompilingError wants to merge 1 commit into
BluePointLilac:masterfrom
CompilingError:fix/packaged-context-menu-discovery
Open

CompilingError wants to merge 1 commit into
BluePointLilac:masterfrom
CompilingError:fix/packaged-context-menu-discovery

Conversation

@CompilingError

Copy link
Copy Markdown

在 Windows 10 上安装 Microsoft Store 版 ChatGPT 后,资源管理器中出现的 “Open Project in ChatGPT” 无法在本程序中找到。现有打包应用菜单仅从 UwpModeItemsDic.xml 和 GuidInfosDic.ini 加载,因此未收录的新应用会被遗漏。

此修改从已注册应用的 AppxManifest.xml 读取 windows.fileExplorerContextMenus 声明,支持 desktop4/desktop5 菜单节点,验证对应的打包 COM 类存在,并按声明的 ItemType 加载到对应场景。已有字典项目优先,同一场景按 CLSID 去重;未知项目以包名和菜单内部 ID 显示,沿用现有 GUID 屏蔽、恢复和注册表导出操作。清单发现过程只读取注册表和文件,单个不可访问或损坏的包不会中断其他菜单的加载。

同时保留完整包名以定位对应版本,并支持 DllPath 为绝对路径的情况。提交仅包含三个源码文件和一个回归测试脚本。

验证:

  • 完整项目已使用 C# 7.3 编译通过,引用本机已安装的 .NET Framework 程序集。
  • 回归脚本验证 desktop4/desktop5、无关 COM 类过滤、无效 CLSID、包身份和场景匹配;本机合计 97 项断言通过(其中 84 项为已安装菜单注册检查)。
  • 报告者已在 Windows 10 + Microsoft Store 版 ChatGPT 环境试用,并确认达到预期效果。

构建后可运行:

./tests/PackagedContextMenus.Tests.ps1 -AssemblyPath ./ContextMenuManager/bin/Release/ContextMenuManager.exe

This branch has not been deployed

No deployments
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