如何使用简单的预卸载脚本扩展 distutils?
我找到了安装后的问题#1321270 。我目前的主要目标是 bdist_wininst,但我没有找到任何与卸载相关的内容...
澄清一下:
我想在安装后注册一个com服务器并在卸载前取消注册。
扩展答案:
然而,为了事情的完整性,ars 的答案似乎是正确的(我认为文档在这个主题上留下了一些改进的空间......):
我没有按照提及 Question#1321270 的建议 扩展了 distutils.command.install
,但编写了一个名为 scripts/install.py
的新 Python 脚本,并在 setup.py 中设置以下内容:
setup(
...
scripts=['scripts\install.py'],
options = {
...
"bdist_wininst" : {
"install_script" : "install.py",
...
},
}
)
install.py安装时肯定会被调用。看起来,尽管它(尽管文档所说)在卸载时没有被调用......
I found Question#1321270 for post install. My main target for the moment is bdist_wininst, but i did not find anything related to uninstall...
For clarification:
I want to register a com server after installation and de-register it before uninstall.
Extended answer:
ars' answer seems correct, however, for the completeness of things (I think the docs leave some room for improvements on this topic...):
I have NOT as was suggested by mention of Question#1321270 extended distutils.command.install
, but written a new python sript called scripts/install.py
and set the following in setup.py:
setup(
...
scripts=['scripts\install.py'],
options = {
...
"bdist_wininst" : {
"install_script" : "install.py",
...
},
}
)
The install.py is definitively being called on install. It seems, though that it is (despite to what the docs say) not being called on uninstall...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相同的安装后脚本将在卸载时使用不同的参数运行。有关详细信息,请参阅文档:
The same post-install script will run at uninstall with different arguments. See the docs for more info: