python - 用Python编写shell扩展并编译

标签 python executable py2exe cx-freeze shell-extensions

我正在尝试创建 shell 扩展上下文菜单和图标覆盖。我已成功注册,并在右键单击时看到上下文菜单出现,并且在通过 Python 运行程序时,菜单单击正确响应了代码。

我的问题是当我尝试使用 cx_Freeze 或 py2exe 将 Python 代码编译为可执行文件时。它构建可执行文件并运行可执行文件创建一个注册表项,但重新启动 explorer.exe 后右键单击时不会显示菜单。

我认为 cx_Freeze 或 py2exe 能够注册上下文菜单或覆盖层并让它与 exe 中的代码对话。我需要制作dll文件吗?我对 com 服务器不是很熟悉,所以任何有 shell 扩展经验的人都会非常感激。

如果要求/需要,我可以提供更多详细信息。

最佳答案

我能够按照此 link 中的步骤通过 dll 注册上下文菜单。 。我最终使用 py2exe for 2.7,我不确定他们使用的设置是否修复了它,或者我在注册 dll 时是否需要使用 regsvr32 而不是自注册表可执行文件。我还使用了链接答案中的修补后的 py2exe

链接: Com server build using Python on 64-bit Windows 7 machine

关于python - 用Python编写shell扩展并编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24455522/

相关文章:

c++ - 'make' 的输出是共享对象,而不是可执行文件

cocoa 或 Bash : Test if a file is an executable binary

Python Windows 服务 pyinstaller 可执行文件错误 1053

python - .PY 转换为 .EXE Python 2.6

python - Pandas 数据框 : Group by two columns and then average over another column

python - 如何使这个功能更容易测试?

Python Cleaner 获取字符串中所有子字符串的方法

javascript - 将 HTML5 + Javascript 文件打包到 .exe 中

python - 从使用命令行参数的python制作exe文件

python - 由于 osgProducer 链接错误,无法安装 PyOSG