开发者

How to extend distutils with a simple pre uninstall script?

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 seem开发者_如何学Pythons, though that it is (despite to what the docs say) not being called on uninstall...


The same post-install script will run at uninstall with different arguments. See the docs for more info:

This script will be run at installation time on the target system after all the files have been copied, with argv1 set to -install, and again at uninstallation time before the files are removed with argv1 set to -remove.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜