From: Nils on
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
From: Nils on
On 5 Aug., 20:26, Nils <andresen.n...(a)googlemail.com> wrote:
> According to the docs in [1] [...]
and with [1] I meant http://docs.python.org/distutils/builtdist.html#the-postinstallation-script

Nils
From: Mark Hammond on
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
From: Nils on
On 6 Aug., 04:02, Mark Hammond <skippy.hamm...(a)gmail.com> wrote:
> 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.