classification
Title: Windows installer can't recover partially installed state
Type: behavior Stage: needs patch
Components: Installation Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: LlelanD, Zbee, jwalterclark, loewis, steve.dower, terry.reedy
Priority: normal Keywords:

Created on 2014-09-03 00:26 by LlelanD, last changed 2015-08-06 14:09 by Zbee.

Messages (13)
msg226291 - (view) Author: Curtis Clauson (LlelanD) Date: 2014-09-03 00:26
Python v3.4.1 x64 on Windows 7 x64.

If the python installation directory is deleted, the installer can not remove, change, or repair the installation.

When I run the python-3.4.1.amd64.msi installer and choose Remove, it gives me a dialog saying a required file is missing about halfway through. It gives me no clue as to what this file is.

If I choose Repair, it gives me a dialog saying "The specified account already exists" about halfway through. Totally cryptic.

If I choose Change and either select that all features or no features will be installed, it gives me a dialog saying "The specified account already exists" about halfway through.

It turns out that the installer is relying on both files in the installation directory and a Windows Intaller key. If the required files are missing, the installer refuses to either remove or repair. If the Windows Installer key still exists, the installer refuses to re-install. When this key is removed, an install can then be done. To be safe, a remove should then be done to clear up any problems and then another clean install.

Both of these requirement violate good MSI practice. You are *NEVER* to use a Windows Installer key as an indication of the installed state because that list can be, and often is, easily corrupted. The installer should always be able to perform a complete repair and especially remove without requiring *ANY* installed files or registry keys.

This installer desperately needs a complete re-write. It should use its own key to indicate whether the application is installed but should not depend on it in case of a partially installed/removed state, should not require any installed file or registry key to fully repair or remove the application, should be able to re-install no matter the state of a previous installation, and should query the user if any information required is missing from the installation or registry. In other words, the normal MSI installer guidelines.
msg226292 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-09-03 02:01
I and at least one other person reporting on python-list have had similar problems trying to update an installation.
msg226293 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2014-09-03 02:44
I've been working on the rewrite for 3.5 already (progress at http://hg.python.org/sandbox/steve.dower) - redoing the installer completely was one of the conditions for when I signed on to own it.

Martin is still responsible for 3.4, and I'm building 2.7 as required but not working on the installer at all.

If this bug needs to be fixed in 3.4, it should be assigned to Martin. Otherwise, if it only needs to be fixed in 3.5, it can be assigned to me and I'll (try and) remember to make this scenario work. (Basically, uninstall may need to reinstall some files - this is probably the uninstall step for pip, but I'm not 100% sure.)

To find out exactly what isn't working, you should be able to run the following command:

msiexec /l*vx log.txt /x {D54842CB-F761-30BA-881F-1FF821DC44DF}

log.txt can be a full path to any location - the UUID is the product code for 3.4.1 x64. You can attach it here and I'll take a look, or you can check it yourself for the error. Either way, I don't intend to fix it for 3.4.
msg239621 - (view) Author: J. Walter Clark (jwalterclark) Date: 2015-03-30 16:22
I had the same issue using Python 3.4.2 x64 on Windows 7 x64 and resolved it by setting PYTHONHOME and PYTHONPATH environmental variables.
msg248060 - (view) Author: Ethan Henderson (Zbee) Date: 2015-08-05 19:17
I have the same issue on 3.4.3 x64 on Windows 10 x64.

I set PYTHONHOME and PYTHONPATH (Just to C:/Python34), but that didn't fix the problem.
msg248065 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-08-05 19:48
+Martin, who apparently never made it onto nosy.

You should clear those variables, run a Repair, and then uninstall. This error typically is because pip has become corrupted and cannot be removed.

This does not affect Python 3.5 or later.
msg248067 - (view) Author: Ethan Henderson (Zbee) Date: 2015-08-05 19:55
I deleted those variables and tried running a repair but still got the "specified account already exists" schpeel.
I then tried running an uninstall and got the same error as last time there too.

There's presently no pip at all; there is no python folder on C:/.
msg248073 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-08-05 20:22
I need to see the detailed log to be any more helpful. Can you try running this command and post the log here:

msiexec /l*vx log.txt /x {9529565F-E693-3F11-B3BF-8CD545F5F9A0}

(Note that the UUID is different from earlier because it matches 3.4.3.amd64 and the previous was for another version)
msg248078 - (view) Author: Ethan Henderson (Zbee) Date: 2015-08-05 20:52
Running that in my command prompt outputs "Access is denied," even after disabling UAC.
Running that in bash just gives me a popup for Windows Installer.

Is the UUID going to be different for 3.4.3 intel x64 (I have intel, not amd)?
msg248080 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-08-05 21:43
Start from an elevated command prompt. There's only one 64-bit build, so that'll be it. Our name for it is amd64, even though it applies to both Intel and AMD.
msg248085 - (view) Author: Ethan Henderson (Zbee) Date: 2015-08-05 22:06
My log.txt: http://puu.sh/jqLWR.txt

Turns out that my antivirus was blocking that command from running before.
msg248086 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-08-05 22:42
Thanks. Unfortunately I can't get anything helpful from that log because it's failing too early. It seems like you have some corruption in your Windows installer database, since it isn't even getting far enough into the Python installer. I'd track down a troubleshooter or reputable system cleaner and see if you can clean up your system.
msg248129 - (view) Author: Ethan Henderson (Zbee) Date: 2015-08-06 14:09
I managed to resolve the issue following these steps:
1. Installing Python 3.4.3 on another computer (not even the same architecture)
2. Copying the Python34 folder from that other computer to the computer I broke
3. Running the uninstaller for Python 3.4.3
4. Reinstalling Python 3.4.3 normally as it is now removed correctly

I also replicated this error in 2.7.10 and fixed it with only slightly different steps:
1. Installing Python 2.7.10 on another computer (again, not even the same architecture as the broken computer)
2. Copying the Python27 folder from that other computer to the computer I broke
3. Running the repair tool for Python 2.7.10
4. Running the uninstaller for Python 2.7.10
5. Reinstalling Python 2.7.10 normally as it is now removed correctly

I replicated the issue in 2.7.10 again afterwards, and it does appear that step 3 is required.
History
Date User Action Args
2015-08-06 14:09:41Zbeesetmessages: + msg248129
2015-08-05 22:42:09steve.dowersetmessages: + msg248086
2015-08-05 22:06:23Zbeesetmessages: + msg248085
2015-08-05 21:43:34steve.dowersetmessages: + msg248080
2015-08-05 20:52:28Zbeesetmessages: + msg248078
2015-08-05 20:22:42steve.dowersetmessages: + msg248073
2015-08-05 19:55:54Zbeesetmessages: + msg248067
2015-08-05 19:48:24steve.dowersetnosy: + loewis

messages: + msg248065
versions: - Python 3.5
2015-08-05 19:17:56Zbeesetnosy: + Zbee
messages: + msg248060
2015-03-30 16:22:15jwalterclarksetnosy: + jwalterclark
messages: + msg239621
2014-09-03 02:44:07steve.dowersetmessages: + msg226293
2014-09-03 02:01:19terry.reedysetversions: + Python 3.5
nosy: + terry.reedy

messages: + msg226292

stage: needs patch
2014-09-03 00:26:07LlelanDcreate