pre-uninstall script in bdist_wininst

Discussion in 'Python' started by Nils, Aug 5, 2010.

  1. Nils

    Nils Guest

    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
     
    Nils, Aug 5, 2010
    #1
    1. Advertising

  2. Nils

    Nils Guest

    Nils, Aug 5, 2010
    #2
    1. Advertising

  3. Nils

    Mark Hammond Guest

    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
     
    Mark Hammond, Aug 6, 2010
    #3
  4. Nils

    Nils Guest

    On 6 Aug., 04:02, Mark Hammond <> 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.
     
    Nils, Aug 8, 2010
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Gonnerman
    Replies:
    7
    Views:
    448
    John Machin
    Aug 9, 2003
  2. Peter Schmiedeskamp
    Replies:
    1
    Views:
    554
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Nov 1, 2003
  3. Dominic

    bdist_wininst strangeness

    Dominic, May 6, 2004, in forum: Python
    Replies:
    0
    Views:
    358
    Dominic
    May 6, 2004
  4. Rahul
    Replies:
    0
    Views:
    614
    Rahul
    Apr 24, 2008
  5. Am Nym
    Replies:
    4
    Views:
    752
    Am Nym
    May 21, 2012
Loading...

Share This Page