'Add/Remove Programs' entry missing for 'current user only' 32-bit installations on 64-bit Windows

Hi all. This seems like it should be an 'old' issue, but I have not been able to find anything related to it on the web. When you install 32-bit CPython 'for the current user only' on 64-bit Windows, the installation does not show up in the Windows 'Add/Remove Programs' dialog (a.k.a. 'Programs and Features' dialog on Windows 7). It does not show up there even for the current user. As a consequence it is possible for the user to end up in a situation where it is impossible to install a 32-bit Python installation without manually cleaning up a previous 32-bit Python installation's Windows Installer related registry entries (more on this a bit later). I tested this CPython installation behaviour with the following CPython versions: * 2.3.4 - works correctly * 2.5.4 - works correctly * 2.6.0 - works correctly * 2.6.2 - works correctly * 2.6.3 - does not work correctly * 2.6.4 - does not work correctly * 2.6.6 - does not work correctly * 2.7.6 - does not work correctly * 3.3.3 - does not work correctly * 3.3.5 - does not work correctly * 3.4.0 - does not work correctly Several related observations, indicating that this could be some sort of a Windows Installer misconfiguration issue possibly solvable in the CPython installer: * The same does not occur when you install a 64-bit CPython version - their entry is correctly displayed in the 'Add/Remove Programs' dialog. * 32-bit CPython installer still correctly detects that a specific 32-bit version has already been installed, even if that previous installation is not listed in the 'Add/Remove Programs' dialog. * When you ask Windows using its WMI interface to list all the products installed on it (e.g. by running 'wmic product list' on the command-line), all the installed CPython versions are correctly displayed, even those 32-bit versions not displayed in the 'Add/Remove Programs' dialog. I started looking into this because I had a 32-bit CPython 3.4.0rc3 installation on my system that I wanted to remove, and since I did not see it registered in the 'Add/Remove Programs' dialog, I directly deleted its installation folder. That left my system in a state where a replacement 32-bit CPython 3.4.0 installation would always fail because it would detect that there was already a valid CPython 3.4 installation on the system, and then it would fail attempting to uninstall it. Fixing this required manually cleaning up leftover CPython 3.4.0rc3 windows installer registry entries. Note that the issue could not be fixed by using the CPython 3.4.0rc3 installer as it failed due to the same problem. This situation would suggest that something should be done in the Windows installer so it does not 'fail miserably' if a previous CPython installation can not removed. Possibly allow it to detect that the previous CPython installation has already been removed and simply clean up its Windows Installer registry entries. While working on this, I did discover a 'workaround' for the 'Add/Remove Programs' dialog issue, but it will take someone more knowledgeable about the Windows Installer infrastructure to say if the workaround can be applied directly as a clean solution or if it could have hidden consequences: Each 32-bit installation on 64-bit Windows has its own 'Uninstall' registry key under:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
named after its Windows Installer assigned GUID, e.g.:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{A37F2D73-72D1-364D-BA5D-CEA430BCC040}
In that key there is a value named 'WindowsInstaller' which for CPython installations has the value '1' (of type REG_DWORD). If you change that value to '0' (again, of type REG_DWORD), the installation's 'Add/Remove Programs' dialog entry will get displayed correctly, and user will be able to run the installation (reinstall/change/uninstall) from there. I compared MSI packaging related CPython source code (Tools/msi folder) in 2.6.2 & 2.6.3 releases but I can not see anything suspicious there. It could be that the observed beaviour change between those two versions is a result of the final release packager changing his used Windows Installer version, but I have not rebuilt CPython, and its MSI installer to test this theory out. Anyone have any more information on this? Should I open a 'Add/Remove Programs' dialog related issue in the CPython issue tracker? And possibly a separate one for making CPython installations not fail without possible recovery if a previous CPython installation has already been removed? Many thanks. Best regards, Jurko Gospodnetić P.S. All this has been tested using Windows 7 SP1 (x64).

Am 17.03.14 22:10, schrieb Jurko Gospodnetić:
Did you try the 3.4.0rc3 "repair" installation? That should have undeleted (repaired) the files that you had manually deleted.
I believe I switched the entire Windows installation at least once in this time (from XP to Windows 7), so it's unlikely related to my personal installation.
Should I open a 'Add/Remove Programs' dialog related issue in the CPython issue tracker?
Please do. It would also good if somebody volunteered to reproduce the issue.
Please don't. Or, at least, make it more specific. If you have manually corrupted your Python installation (by deleting essential files), you have to accept that the system installation procedures will fail. It might be possible to recover from the loss of a specific such file; for that, we would have to identify what the file is. However, the standard procedure should be to repair the installation before attempting an upgrade. Regards, Martin

Hi. On 19.3.2014. 16:38, "Martin v. Löwis" wrote:
I tried different things back then, and I'm 90% sure I tried that one as well. Unfortunately, my brain is already trying to block out that painful afternoon so I can't tell you for certain. :-) But, all kidding aside, I'll try to reproduce the issue again and let you know the exact details.
Will do. FYI, I did reproduce the 'Add/Remove Programs' dialog issue on another PC in the mean time. Also Windows 7 x64 though. Unfortunately, I don't have other 64-bit OSs readily available at the moment.
Ok, as I stated above, I'll get back to you on this once I reproduce the 'corruption' issue again. Oh, and many thanks for replying! :-) Best regards, Jurko Gospodnetić

Hi.
Opened issue #20984. http://bugs.python.org/issue20984 Anyone have Windows 8 x64 available to try this out by any chance? Best regards, Jurko Gospodnetić

Hi. On 19.3.2014. 16:38, "Martin v. Löwis" wrote:
Just tested this out and repairing the same matching installation does revert the removed files. It does not reinstall pip and setuptools packages but that can be done easily by hand and so can be filed as a minor enhancement issue for the future. That at least provides a way to remove the the original installation in some way without having to manually remove its related Windows Installer registry entries. The problem with the 'Add/Remove Programs' dialog still makes this issue a bit complicated because a user not well versed in how Windows Installer tracks its installations internally would not see the installation in the 'standard place' where he is supposed to look for it, and would just be told by the new installation that 'something failed'. To use a 'repair' installation he would need to 'guess' which installation he used before and run its installer directly. When the 'Add/Remove Programs' dialog is fixed, user will be able to see & repair the installation from there, and even remove it directly if the uninstallation fails (I recall Windows asking if you want this if it can not uninstall something). I'll try to open an issue for the 'Add/Remove Programs' dialog issue soon, and I'll add a comment about the 'repair' situation there as well. Best regards, Jurko Gospodnetić

Hi.
This minor problem reported as issue #20983. http://bugs.python.org/issue20983 Best regards, Jurko Gospodnetić

Am 17.03.14 22:10, schrieb Jurko Gospodnetić:
Did you try the 3.4.0rc3 "repair" installation? That should have undeleted (repaired) the files that you had manually deleted.
I believe I switched the entire Windows installation at least once in this time (from XP to Windows 7), so it's unlikely related to my personal installation.
Should I open a 'Add/Remove Programs' dialog related issue in the CPython issue tracker?
Please do. It would also good if somebody volunteered to reproduce the issue.
Please don't. Or, at least, make it more specific. If you have manually corrupted your Python installation (by deleting essential files), you have to accept that the system installation procedures will fail. It might be possible to recover from the loss of a specific such file; for that, we would have to identify what the file is. However, the standard procedure should be to repair the installation before attempting an upgrade. Regards, Martin

Hi. On 19.3.2014. 16:38, "Martin v. Löwis" wrote:
I tried different things back then, and I'm 90% sure I tried that one as well. Unfortunately, my brain is already trying to block out that painful afternoon so I can't tell you for certain. :-) But, all kidding aside, I'll try to reproduce the issue again and let you know the exact details.
Will do. FYI, I did reproduce the 'Add/Remove Programs' dialog issue on another PC in the mean time. Also Windows 7 x64 though. Unfortunately, I don't have other 64-bit OSs readily available at the moment.
Ok, as I stated above, I'll get back to you on this once I reproduce the 'corruption' issue again. Oh, and many thanks for replying! :-) Best regards, Jurko Gospodnetić

Hi.
Opened issue #20984. http://bugs.python.org/issue20984 Anyone have Windows 8 x64 available to try this out by any chance? Best regards, Jurko Gospodnetić

Hi. On 19.3.2014. 16:38, "Martin v. Löwis" wrote:
Just tested this out and repairing the same matching installation does revert the removed files. It does not reinstall pip and setuptools packages but that can be done easily by hand and so can be filed as a minor enhancement issue for the future. That at least provides a way to remove the the original installation in some way without having to manually remove its related Windows Installer registry entries. The problem with the 'Add/Remove Programs' dialog still makes this issue a bit complicated because a user not well versed in how Windows Installer tracks its installations internally would not see the installation in the 'standard place' where he is supposed to look for it, and would just be told by the new installation that 'something failed'. To use a 'repair' installation he would need to 'guess' which installation he used before and run its installer directly. When the 'Add/Remove Programs' dialog is fixed, user will be able to see & repair the installation from there, and even remove it directly if the uninstallation fails (I recall Windows asking if you want this if it can not uninstall something). I'll try to open an issue for the 'Add/Remove Programs' dialog issue soon, and I'll add a comment about the 'repair' situation there as well. Best regards, Jurko Gospodnetić

Hi.
This minor problem reported as issue #20983. http://bugs.python.org/issue20983 Best regards, Jurko Gospodnetić
participants (3)
-
"Martin v. Löwis"
-
Andrew M. Hettinger
-
Jurko Gospodnetić