Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > pre-uninstall script in bdist_wininst

Reply
Thread Tools

pre-uninstall script in bdist_wininst

 
 
Nils
Guest
Posts: n/a
 
      08-05-2010
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
 
Reply With Quote
 
 
 
 
Nils
Guest
Posts: n/a
 
      08-05-2010
On 5 Aug., 20:26, Nils <(E-Mail Removed)> wrote:
> According to the docs in [1] [...]

and with [1] I meant http://docs.python.org/distutils/bui...llation-script

Nils
 
Reply With Quote
 
 
 
 
Mark Hammond
Guest
Posts: n/a
 
      08-06-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
 
Reply With Quote
 
Nils
Guest
Posts: n/a
 
      08-08-2010
On 6 Aug., 04:02, Mark Hammond <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bdist_wininst post-install bug? Fernando Perez Python 0 01-28-2005 09:29 AM
Installer made with bdist_wininst segfaulting... Fernando Perez Python 3 01-25-2005 05:49 PM
bdist_wininst strangeness Dominic Python 0 05-06-2004 08:48 PM
Distutils: bdist_wininst. System integration use. (--silent option?,etc.) Peter Schmiedeskamp Python 1 11-01-2003 08:49 AM
Building extensions with mingw32 -- bdist_wininst fails. Chris Gonnerman Python 7 08-08-2003 11:19 PM



Advertisments