无法通过 CLI (msi file/windows) 卸载 Python 2.7.18

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

我目前正在改进一个软件的卸载程序,它还会在旁边安装 Python (2.7.18)。

软件本身安装在这样的位置:D:\X 并使用子文件夹中的 Python:D:\X\python

要在软件安装过程中安装python,Python.msi文件是这样调用的:
python-2.7.18.msi /qn INSTALLDIR=D:\X\python TARGETDIR=D:\X\python ALLUSERS=1

过去使用的是旧 python 版本。我的实际问题是,例如当我尝试卸载并重新安装不同或旧版本时 - 我可能会遇到 python 版本冲突,因为卸载程序不会卸载,但只会删除 python 文件夹

在卸载我的软件的过程中,我必须从该位置卸载 Python 解释器。
我只是尝试 python-2.7.18.msi /uninstall 然后弹出一条错误消息
我还尝试了安装过程中的路径参数(我在文档中找不到):
python-2.7.18.msi /uninstall INSTALLDIR=D:\X\python TARGETDIR=D:\X\python ALLUSERS=1

无论我尝试什么,卸载程序都会弹出此错误消息(德语):

我还通过 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 ===

日志告诉我没有有效的更新包,而且安装失败。 这里的更新包是什么意思?我确实有来自 python.org

的有效 Python.msi 文件

重要提示:当手动打开MSI文件,并通过GUI点击时——卸载是没有问题的! 只有通过 CLI 卸载时才会出现这种情况!

我是不是用错了卸载程序?卸载过程中是否存在真正的错误?
所有命令均以完整的本地管理员权限执行

非常感谢任何帮助

感谢@Stein-Asmul 我在这里找到了解决方案:Uninstalling an MSI file from the command line without using msiexec

不再像 python-2.7.18.msi /uninstall 那样调用我的 msi 文件 - 我现在从 Windows 调用 msiexec.exe: msiexec.exe /x "D:\X\python-2.7.18.msi" /QN REBOOT=R

就我而言,这很完美