正在使用 Desktop Bridge 安装 shell 扩展

Installing shell extension using Desktop Bridge

我的 Win32 应用程序需要安装 Windows Explorer Shell 扩展。

我已经使用 Desktop App Converter 为我的应用程序生成 AppX。但是转换器忽略了应用程序的旧版安装程序安装的 shell 扩展。

虽然它捕获了 Classes\Directory\shellexRegistry.dat 的密钥,但密钥条目指向未捕获的 CLSID。即使它确实捕获了引用的 CLSID,它也指向旧版安装程序安装应用程序的路径,而不是将安装 AppX 的真实位置。


我正在考虑在第一个 运行 上通过应用程序本身注册扩展。但是C:\Program Files\WindowsApps中的安装位置权限受限,所以regsvr32失败。

The module "C:\Program Files\WindowsApps\WinSCP_5.14.0.0_x86__2dz6xbp7ps3z2\DragExt64.dll" failed to load.

Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

Access is denied.


权限确实允许将文件复制到其他地方。所以我可以将 .dll 复制到例如用户配置文件 (C:\Users\...) 并从那里注册。但是当 AppX 被卸载时,这将留下 .dll。

有没有更好的解决方案?

Windows10 上打包的 Win32 应用程序(桌面桥应用程序)的设计原则是它们通过 appxmanifest(而不是通过注册表)以声明方式与 Shell 集成。为了促进这一点,我们向清单方案添加了 Shell 扩展。系统将 运行 那些带有 Shell 的进程外扩展(与经典的进程内扩展不同),以允许无缝应用程序更新并防止应用程序崩溃 Windows Shell/Explorer.

请参阅此处获取文档: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extensions

编辑 请注意,目前并非所有现有的 Shell 扩展都受支持。为了帮助我们优先考虑任何仍然缺失的问题,请在 UserVoice 上记录它们: https://wpdev.uservoice.com/forums/110705-universal-windows-platform