pre-uninstall script in bdist_wininst

Mark Hammond skippy.hammond at gmail.com
Thu Aug 5 22:02:50 EDT 2010


On 6/08/2010 4:26 AM, Nils wrote:
> Hi.
> I am using a postinstall-script like this:
> setup(
>      ...
>      scripts=['scripts\install.py'],
>      options = {
>          ...
>          "bdist_wininst" : {
>              "install_script" : "install.py",
>              ...
>          },
>      }
> )
>
> According to the docs in [1] this script is
> a) called after install (with the "-install" parameter) - this works
> fine for me...
> b) called before uninstall (with tho "-remove" parameter) - this
> however does not work.

According to a comment in pywin32's post-install script:

         elif arg == "-remove":
             # bdist_msi calls us before uninstall, so we can undo what we
             # previously did.  Sadly, bdist_wininst calls us *after*, so
             # we can't do much at all.

So it seems possible your script is failing due to an import error as 
your module has already been removed.  Maybe a .msi would work better 
for you.

> btw: With that I am trying to register a com-server on install and de-
> register on uninstall - so if other ideas are around I'd love to hear
> them, too...

I'd suggest using py2exe to package the object and inno installer or 
similar to handle the install and uninstall parts.

Mark



More information about the Python-list mailing list