views:

27

answers:

1

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...

A: 

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.

ars
looks correct, but does not happen. Is it possible that the unistallation part is not correct for bdist_wininst ??
Nils
I think the script has to be in the root directory (your setup indicates it's under a "scripts" folder).
ars
No, regardless of where the script resides (root, subdirectory) it is only used in post-install, never in pre-uninstall. This happens on Win7, amd64. I'll try on WinXP, x86 tonight.
Nils
I thinkt this is a correct answer as it's what the docs say _should_ work…
Nils