简体   繁体   中英

Unable to uninstall Python 2.7.18 via CLI (msi file/windows)

I am currently improving an Uninstaller for a Software, that also installs Python (2.7.18) next to it.

The Software itself gets installed in a location like this: D:\X and uses Python from a subfolder: D:\X\python

To install python during the software installation process, the Python.msi file is being called in this way:
python-2.7.18.msi /qn INSTALLDIR=D:\X\python TARGETDIR=D:\X\python ALLUSERS=1

In past there were older python versions used instead. My actual problem is, eg when I try uninstall and reinstall with different or older versions - I might get a python version conflict as the uninstaller doesnt uninstall, but only deletes the python folder

In process of uninstalling my Software, I have to uninstall the Python Interpreter from that location.
I simply tried python-2.7.18.msi /uninstall which then pops up an error message
I also tried the path Arguments from the installing process (which I can't find in doc):
python-2.7.18.msi /uninstall INSTALLDIR=D:\X\python TARGETDIR=D:\X\python ALLUSERS=1

whatever I try, the uninstaller pops up this error message (german):
卸载错误
I also took the verbose log via python-2.7.18.msi /lv log.txt /uninstall :

MSI (c) (E8:D4) [16:43:14:912]: Unable to create a temp copy of patch 'CURRENTDIRECTORY="D:\X\python"'.
Das Updatepaket konnte nicht geöffnet werden. Stellen Sie sicher, dass das Updatepaket vorhanden ist und dass Sie darauf zugreifen können, oder wenden Sie sich an den Hersteller, um sicherzustellen, dass es sich um ein gültiges Updatepaket handelt.
D:\X\python\python-2.7.18.msi
MSI (c) (E8:D4) [16:43:14:912]: Note: 1: 1708 
MSI (c) (E8:D4) [16:43:14:912]: Product: Python 2.7.18 -- Installation failed.

MSI (c) (E8:D4) [16:43:14:912]: Windows Installer installed the product. Product Name: Python 2.7.18. Product Version: 2.7.18150. Product Language: 1033. Manufacturer: Python Software Foundation. Installation success or error status: 1635.

MSI (c) (E8:D4) [16:43:14:928]: MainEngineThread is returning 1635
=== Verbose logging stopped: 11.05.2020  16:43:14 ===

The log tells I do not have a valid Update-package and also an Install failed. What update package is meant here? I do have the valid Python.msi file from python.org

Important: When manually opening the MSI file, and clicking through the GUI - Uninstalling is no problem! This situation only occurs when uninstalling via CLI!

Am I using the uninstaller wrong? Is there a real error in the uninstall process?
All Commands were executed with full local admin rights

Any help is much appreciated

Thanks to @Stein-Asmul I found a solution here: Uninstalling an MSI file from the command line without using msiexec

Instead of calling my msi file like python-2.7.18.msi /uninstall - I am now calling msiexec.exe from Windows: msiexec.exe /x "D:\X\python-2.7.18.msi" /QN REBOOT=R

This in my case, works perfect

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM