Vor einiger Zeit versuchte ich, die Erweiterung „Fantastic Schoolbag“ für LibreOffice zu paketieren. Nach einigen Schwierigkeiten gelang es mir schließlich, und ich stelle das Paket hier zur Verfügung, falls es für jemanden nützlich sein könnte. (Dieses Paket benötigt ein Installationspaket für LibreOffice.)
Code: Alle auswählen
# -*- coding: utf-8 -*-
from setuphelpers import *
r"""Pour information : installation avec unopkg.exe pour tous les utilisateurs (argument --shared) inopérante (avec LO 25.8.6)
-> utiliser unopkg.exe pour chaque utilisateur via fonction session_setup() """
source_dir=makepath('C:','cachefileWAPT','LibreOffice_extensions','Lbo_CartableFantastique_college')
def install():
#copie du dossier de l'extension en local
if not isdir(source_dir):
mkdirs(source_dir)
print(f"Copie de l'extension Cartable Fantastique dans {source_dir}")
filecopyto('Lbo_CartableFantastique_college.v5.oxt',source_dir)
print("Installation terminée avec succès")
def session_setup():
run(r'"C:\Program Files\LibreOffice\program\unopkg.exe" add --suppress-license "C:\cachefileWAPT\LibreOffice_extensions\Lbo_CartableFantastique_college\Lbo_CartableFantastique_college.v5.oxt"')
def session_cleanup():
r"""Désinstallation de l'extension dans les profils utilisateurs
Attention, pour obtenir l'id de désinstallation de l'extension utiliser unopkg.com list et non unopkg.exe list qui ne renvoie rien"""
if installed_softwares('LibreOffice'):
run_notfatal(r'"C:\Program Files\LibreOffice\program\unopkg.exe" remove vnd.cmfpmatik.cartablefantastique')
def uninstall():
print("Suppression du dossier de l'extension Cartable Fantastique")
if isdir(source_dir):
remove_tree(source_dir)
if dir_is_empty(makepath('C:','cachefileWAPT','LibreOffice_extensions')):
remove_tree(makepath('C:','cachefileWAPT','LibreOffice_extensions'))
print("Désinstallation terminée avec succès")
Wenn ich jedoch nach der Deinstallation des wapt-Pakets für einen Benutzer die Eingabeaufforderung öffne und die Funktion session_cleanup ausführe:
Code: Alle auswählen
U:\>wapt-get session-cleanup col73-libreoffice-extension-cartable-fantastique-college
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
0
U:\>
Überraschenderweise funktioniert es, wenn ich den Befehl session_cleanup function in einer Eingabeaufforderung innerhalb der Benutzersitzung (mit Benutzerrechten, nicht mit Administratorrechten) ausführe:
Code: Alle auswählen
U:\>"C:\Program Files\LibreOffice\program\unopkg.exe" remove vnd.cmfpmatik.cartablefantastique
U:\>
Ich verstehe nicht, woher das Problem kommt. Haben Sie eine Idee?
