Ich habe ein Paket zur Installation von Office 2019 über das officedeploymenttool erstellt und gebe den Deinstallationsschlüssel in den Parametern der Funktion install_exe_if_needed() an.
Die Installation verläuft problemlos, aber beim Ausführen des Deinstallationsbefehls erhalte ich folgende Fehlermeldung:
Code: Alle auswählen
Command Line : remove "C:\waptdev\pilote-regtest_1.0_x64_Windows_PROD-wapt\WAPT\.."
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Removing C:\waptdev\pilote-regtest_1.0_x64_Windows_PROD-wapt\WAPT\.. ...
2024-06-14 11:19:04,815 CRITICAL Critical error during uninstall: CalledProcessErrorOutput: Command ['"C:\\Program Files\\Common Files\\Microsoft Shared\\ClickToRun\\OfficeClickToRun.exe" scenario=install scenariosubtype=ARP sourcetype=None productstoremove=Standard2019Volume.16_fr-fr_x-none culture=fr-fr version.16=16.0'] returned non-zero exit status 1.
Output:La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte.
Um das Problem zu umgehen, habe ich eine uninstall.xml-Konfigurationsdatei erstellt, die die Deinstallation meiner Office-Version ermöglicht. Während der Installation kopiere ich diese Datei und die notwendige setup.exe in ein Office-Verzeichnis.
Meine Idee ist es, die remove()-Funktion zu überschreiben, sodass sie "setup.exe /configure uninstall.xml" ausführt.
Aber auch hier stoße ich auf ein Problem: Ich habe nicht das Gefühl, dass meine Überschreibung funktioniert, wenn ich den Befehl zum Entfernen der Konfiguration ausführe, da ich den gleichen Fehler wie oben erhalte.
Hier ist meine setup.py:
Code: Alle auswählen
from setuphelpers import *
def install():
uninstall_key = "Standard2019Volume - fr-fr"
office_path = makepath("C:","Program Files","Microsoft Office")
office_uninstall_path = makepath("C:","Program Files","Microsoft Office","Uninstall")
print("Debut")
install_exe_if_needed("setup.exe", silentflags="/configure Install.xml", key=uninstall_key, timeout=None, min_version='')
print('Install ok')
mkdirs(office_uninstall_path)
filecopyto("setup.exe",office_uninstall_path)
filecopyto("Uninstall.xml",office_uninstall_path)
print("Répertoire et fichiers desinstallation OK")
def remove():
office_uninstall_path_setup = makepath("C:","Program Files","Microsoft Office","Uninstall","setup.exe")
office_uninstall_path_config = makepath("C:","Program Files","Microsoft Office","Uninstall","Uninstall.xml")
print('Debut uninstall')
run(office_uninstall_path_setup + ' /configure ' + office_uninstall_path_config)
print('uninstall OK')
