无法通过 CLI 卸载 Python 2.7.18 (msi filewindows)

问题描述 投票:0回答:1

我目前正在改进一个软件的卸载程序,同时也在旁边安装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 我还尝试了安装过程中的路径Arguments(我在文档中找不到)。python-2.7.18.msi /uninstall INSTALLDIR=D:\X\python TARGETDIR=D:\X\python ALLUSERS=1

无论我怎么尝试,卸载程序都会弹出这个错误信息(德语)。uninstall error 我还通过 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 ===

日志显示我没有一个有效的Update-package,并且安装失败。这里指的是什么更新包?我确实有来自python.org的有效Python.msi文件。

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

我是不是用错了卸载程序?卸载过程中是否真的出现了错误?所有命令都是以完全的本地管理员权限执行的

恳请帮助

python windows python-2.7 windows-installer uninstall
1个回答
0
投票

感谢 @Stein-Asmul 我在这里找到了一个解决方案。在不使用msiexec的情况下从命令行卸载MSI文件。

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

这对我来说,非常有效

© www.soinside.com 2019 - 2024. All rights reserved.