pre-uninstall script in bdist_wininst

N

Nils

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.

Can someone please point me to the direction on how to get a pre-
uninstall script working?

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

Nils
 
M

Mark Hammond

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
 
N

Nils

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.
Sadly, I can not confirm this. I wrote the simplest install-script
(dump call-parameters to a txt-file) and tested with 2.6 and 2.7
On bdist_wininst my install_script was called on install with
parameter "-install"
On bdist_wininst my install_script was called on install without
parameters
My script was never (ever) called on uninstall...
I'd suggest using py2exe to package the object and inno installer or
similar to handle the install and uninstall parts.
Yes, I'll try that, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top