我目前正在改进一个软件的卸载程序,它也安装在它旁边的Python (2.7.18)。
软件本身安装在如下位置:D:\X
,并从子文件夹:D:\X\python
中使用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
,然后弹出一条错误消息
我还尝试了安装过程中的path参数(在doc中找不到):
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.org文件
的重要性:当手动打开MSI文件,并通过GUI点击卸载是没有问题的!这种情况仅在通过CLI!卸载时才会发生。
我是不是用错了卸载程序?卸载过程中是否存在真正的错误?
所有命令都以完全的本地管理权限执行
任何帮助都非常感谢。
发布于 2020-05-12 13:51:54
多亏@Stein,我在这里找到了一个解决方案:Uninstalling an MSI file from the command line without using msiexec
我现在不是像python-2.7.18.msi /uninstall
那样调用msi文件,而是从msiexec.exe:msiexec.exe /x "D:\X\python-2.7.18.msi" /QN REBOOT=R
调用
在我的例子中,效果很好
https://stackoverflow.com/questions/61733320
复制相似问题