This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年10月27日 15:30 by francisco, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| foo.zip | francisco, 2011年10月27日 15:30 | Simple setup.py file to reproduce the bug. It includes the Windows installer. | ||
| Messages (9) | |||
|---|---|---|---|
| msg146492 - (view) | Author: francisco (francisco) | Date: 2011年10月27日 15:30 | |
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. |
|||
| msg148674 - (view) | Author: Jason Roberts (jasonjroberts) | Date: 2011年11月30日 16:54 | |
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. |
|||
| msg148676 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年11月30日 17:17 | |
(2.6 and 3.1 don’t get bug fixes anymore.) |
|||
| msg184523 - (view) | Author: Pierre Raybaut (Pierre.Raybaut) | Date: 2013年03月18日 21:16 | |
How can I help to ensure that the patch submitted by Jason Roberts is actually taken into account in next releases of Python? I too would want to use this "remove" feature in distutils Windows installers. For example, I was confronted to this bug/limitation of current releases of Python when implementing this feature for the Spyder Windows installer: https://code.google.com/p/spyderlib/issues/detail?id=971#c10 Thanks for taking time to fix this issue. |
|||
| msg186522 - (view) | Author: Jed Ludlow (jed.ludlow) | Date: 2013年04月10日 17:34 | |
I can confirm that the approach suggested in msg148674 resolves this issue for Python 2.7.3 (32-bit Python running on 64-bit Windows 7). For a standard 2.7.3 install, simply replacing wininst-9.0.exe in the command sub-directory of distutils with the patched build of that executable resolved the issue. |
|||
| msg191734 - (view) | Author: anatoly techtonik (techtonik) | Date: 2013年06月23日 21:51 | |
@Pierre.Raybaut: Looking at the stage of this ticker, I believe you need to write unittest. Then attach a patch. If patch is attached, the issue is more visible among developers. |
|||
| msg202567 - (view) | Author: anatoly techtonik (techtonik) | Date: 2013年11月10日 20:21 | |
Here is workaround, which is - patching distutils - https://code.google.com/p/spyderlib/wiki/PatchingDistutils |
|||
| msg260366 - (view) | Author: francisco (francisco) | Date: 2016年02月16日 18:19 | |
I believe that this bug—which I reported in 2011—is not correctly tagged, what may explain why it has not been fixed yet. Despite the fact that the original issue report contains a script to reproduce the bug and that msg148674 contains a patch to fix the issue the State of this issue is "test needed". Shouldn't State be "patch review" instead? |
|||
| msg384819 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2021年01月11日 12:51 | |
The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:23 | admin | set | github: 57485 |
| 2021年01月11日 12:51:21 | vstinner | set | status: open -> closed nosy: + vstinner messages: + msg384819 resolution: wont fix stage: test needed -> resolved |
| 2016年09月21日 04:39:00 | petri | set | nosy:
+ petri |
| 2016年02月16日 18:19:16 | francisco | set | type: behavior messages: + msg260366 versions: + Python 3.6 |
| 2013年11月11日 02:22:11 | brian.curtin | set | nosy:
- brian.curtin |
| 2013年11月10日 20:21:35 | techtonik | set | messages:
+ msg202567 versions: + Python 3.4, Python 3.5 |
| 2013年06月23日 21:51:02 | techtonik | set | messages: + msg191734 |
| 2013年06月23日 21:48:58 | techtonik | set | nosy:
+ techtonik |
| 2013年04月10日 17:34:46 | jed.ludlow | set | nosy:
+ jed.ludlow messages: + msg186522 |
| 2013年03月18日 21:16:35 | Pierre.Raybaut | set | nosy:
+ Pierre.Raybaut messages: + msg184523 |
| 2011年11月30日 17:17:17 | eric.araujo | set | title: distutils bdist_wininst created installer does not run the postinstallation script on uninstalling -> bdist_wininst-created installer does not run the postinstallation script when uninstalling messages: + msg148676 versions: - Python 2.6, Python 3.1 |
| 2011年11月30日 16:54:07 | jasonjroberts | set | messages:
+ msg148674 versions: + Python 2.6, Python 3.1 |
| 2011年11月30日 16:48:08 | eric.araujo | link | issue13509 superseder |
| 2011年11月30日 16:48:01 | eric.araujo | set | nosy:
+ jasonjroberts, brian.curtin stage: test needed versions: + Python 3.2, Python 3.3 |
| 2011年10月27日 15:36:30 | eric.araujo | set | nosy:
+ loewis, mhammond |
| 2011年10月27日 15:30:55 | francisco | create | |