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

Jurko Gospodnetić jurko.gospodnetic at pke.hr
Mon Mar 17 22:10:28 CET 2014


   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).



More information about the Python-Dev mailing list