[issue13276] distutils bdist_wininst created installer does not run the postinstallation script on uninstalling
Changes by Éric Araujo mer...@netwok.org: -- nosy: +brian.curtin, jasonjroberts stage: - test needed versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13276] distutils bdist_wininst created installer does not run the postinstallation script on uninstalling
Jason Roberts jason.robe...@duke.edu added the comment: Sorry, I opened issue13509 after somehow not finding this one. Here is my text from issue13509. Thanks for looking at this problem... Historically (i.e. Python 2.6.1 and earlier) bdist_wininst would run the post install script at both installation and uninstallation. The script would be invoked with a -install argument on installation and a -remove argument on uninstallation. This stopped working in Python 2.6.2 and has not worked since. This regression appears to have been introduced in r69094. That checkin rewrote Run_RemoveScript and associated functions in PC/bdist_wininst/install.c. The rewrite changed how the Python DLL was loaded during the remove scenario. Previously Run_RemoveScript itself called Win32 LoadLibrary on the DLL name parsed from the wininst log file. Now Run_RemoveScript calls run_installscript instead, which ultimately calls LoadPythonDll, which calls LoadLibrary on the pythondll global variable. But nothing initializes that variable during the remove scenario and LoadLibrary fails. Ultimately run_installscript silently fails and the removal proceeds to uninstall files and registry keys, with no notification to the user that the post install script was not run. A possible solution is to initialize pythondll in Run_RemoveScript to the DLL name parsed from the wininst log file, e.g. by inserting the following code prior to the call to run_installscript: strncpy(pythondll, dllname, scriptname - 1 - dllname); pythondll[scriptname - 1 - dllname] = '\0'; I tested this and it seemed to work fine. I believe this problem affects all Python releases following and including 2.6.2. The version history seems to show that r69094 was propagated to all of those releases. Presumably nobody found it because post install scripts on removal are not widely used. They are, however, critical for my application (at least if I want it to clean up properly on removal) so I would appreciate this being fixed. As it stands, I have to build a private patched copy of wininst-9.0.exe to work around this problem. -- versions: +Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13276] distutils bdist_wininst created installer does not run the postinstallation script on uninstalling
New submission from francisco frandelap...@gmail.com: The bug can be reproduced by running the following command to create a Windows installer for the attached module: python setup.py bdist_wininst --install-script pis.py I include also the installer that I have created in the dist folder. The installer installs everything correctly and it runs the pis.py script, which simply creates a file in the USERPROFILE directory with the Installing string. However, when uninstalling the program from the Windows Control Panel the script is not called, what can be verified by checking that the Uninstalling string is not appended to the file. I am experiencing this problem in Windows 7 64 bits, but it may be present in other platforms. -- assignee: tarek components: Distutils files: foo.zip messages: 146492 nosy: eric.araujo, francisco, tarek priority: normal severity: normal status: open title: distutils bdist_wininst created installer does not run the postinstallation script on uninstalling versions: Python 2.7 Added file: http://bugs.python.org/file23536/foo.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13276] distutils bdist_wininst created installer does not run the postinstallation script on uninstalling
Changes by Éric Araujo mer...@netwok.org: -- nosy: +loewis, mhammond ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com