[New-bugs-announce] [issue12200] bdist_wininst install_script not run on uninstall

Mark Hammond report at bugs.python.org
Sat May 28 04:08:47 CEST 2011

New submission from Mark Hammond <skippy.hammond at gmail.com>:

Probably in all versions, but certainly in 2.7.

If you create an installer with bdist_wininst and specify an install_script, that script is not run on uninstallation.

See attached test case: setup.py specifies an install_script which just appends argv to %TEMP%/uninstall-test.txt.

* Create the installer with "python setup.py bdist_wininst"
* Execute the installer (ie, "dist\hello-0.1.win32.exe")
* Check %TEMP%/uninstall-test.txt - it should have 1 line:
['o:\\src\\python-2.6\\Scripts\\hello-install.py', '-install']
* Uninstall the package.
* Check %TEMP%/uninstall-test.txt - it *should* have a new line reflecting the uninstall.  Instead it is unchanged.

To get more info:
* Reinstall the package.
* Manually uninstall using the cmdline (with adjusted paths)
C:\> "c:\python26\Removehello.exe" -u "c:\python26\hello-wininst.log" > %TEMP%\delme.out 2>&1

Check the contents of %TEMP%\delme.out - you will see:
*** Could not load Python ****** Could not run installation script ***

Digging into the source code of install.c - the problem is that although the Python DLL name is parsed from the log file, this isn't reflected in the global variables python_dir or pythondll - so they remain empty strings and attempting to load the empty string as Python causes the error messages.

assignee: tarek
components: Distutils
files: setup.py
messages: 137105
nosy: eric.araujo, mhammond, tarek
priority: normal
severity: normal
status: open
title: bdist_wininst install_script not run on uninstall
type: behavior
Added file: http://bugs.python.org/file22160/setup.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list