Page 1 of 1

[RESOLVED] Package for deploying a LibreOffice extension

Published: February 3, 2025 - 2:15 PM
by brice25
Hello,

The special education teachers in our schools have asked us to install a LibreOffice extension (Le cartable fantastique in .oxt format - https://www.cartablefantastique.fr/outi ... re-office/) on their classroom PCs for multi-user access.

I found a package for a similar extension in the Wapt store: https://wapt.tranquil.it/store/fr/detai ... _PROD.wapt

Do you think it would be possible to easily adapt this package? Has anyone done this before?

Thank you in advance for your feedback.

Brice (IT Director - Grand Besançon Métropole)

Re: Package for deploying a LibreOffice extension

Published: February 4, 2025 - 9:43 AM
by florentR2
Good morning,
Yes, you just need the .oxt file and to run this command, adapting it to your environment:

Code: Select all

unopkg.exe add --shared chemin_makepath\Extension.oxt

Re: Package for deploying a LibreOffice extension

Published: February 4, 2025 - 11:17 AM
by brice25
Thank you for your reply.

Upon analyzing the details of the existing package that I wish to adapt, I think there are other elements to modify besides simply adding the command: "unopkg.exe add --shared chemin_makepath\Extension.oxt"?

I can skip the audit and uninstall.

Could you provide me with more details?

Thanks in advance.

- - - - - - -

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *


def get_unopkg_path():
    unopkg_path = makepath(programfiles, "LibreOffice", "program", "unopkg.com")

    if not isfile(unopkg_path):
        unopkg_path = makepath(programfiles, "Collabora Office", "program", "unopkg.com")

    if not isfile(unopkg_path):
        error("ERROR: Couldn't find path to unopkg.com, verify your LibreOffice installation")

    return unopkg_path

def install():

    if params.get("install_with_luti", False):
        WAPT.install("tis-libreoffice-still")

    extension_name = glob.glob(f"Grammalecte-fr-v{control.get_software_version()}.oxt")[0]
    install_path = get_unopkg_path().split("\\")[:-1]
    install_path = "\\".join(install_path)
    # run(f'"{get_unopkg_path()}" --help') for further information
    print(f"Install path : {install_path}")
    run(f'"{get_unopkg_path()}" add --shared "{extension_name}"')



def audit():
    extension_name = f"Grammalecte-fr-v{control.get_software_version()}.oxt"

    result = run(f'"{get_unopkg_path()}" list --shared "{extension_name}"')
    if extension_name in result:
        return "OK"
    else:
        return "ERROR"


def uninstall():
    extension_name = f"Grammalecte-fr-v{control.get_software_version()}.oxt"

    run(f'"{get_unopkg_path()}" remove --shared "{extension_name}"')

Re: Package for deploying a LibreOffice extension

Published: February 4, 2025 - 1:17 PM
by florentR2
The package is more complete and also allows you to check the installation/removal; I've only provided the basic command to add the extension

Re: Package for deploying a LibreOffice extension

Published: February 4, 2025 - 2:42 PM
by brice25
Thank you, I understood that your command did not include auditing and uninstalling the LibreOffice extension.

How can I upload the .oxt file? And to which server?

From the WAPT console, the standard package model only allows importing .EXE and .MSI files.

Thank you in advance for any clarification.

Re: Package for deploying a LibreOffice extension

Published: February 10, 2025 - 2:05 PM
by blemoigne
Hello,
if I understand correctly what you want to do, you need to include the .oxt file in the package. By default, packages under development are stored in c:\waptdev. You need to place the .oxt file at the same level as the package's setup.py file.
Have a good day,
Bertrand

Re: Package for deploying a LibreOffice extension

Published: October 27, 2025 - 5:18 PM
by brice73
Good morning,

With LibreOffice version 25.2.6 (or even an earlier version?), the command

Code: Select all

unopkg.exe add --shared chemin_makepath\Extension.oxt
It doesn't seem to be working anymore! :|

The same applies to:

Code: Select all

"C:\Program Files\LibreOffice\program\unopkg.exe" add --shared "chemin_makepath\Extension.oxt" 
Does anyone have a solution for installing an extension under LibreOffice 25.2.6 on Windows 10/11?

Re: Package for deploying a LibreOffice extension

Published: October 31, 2025 - 1:02 PM
by dcardon
Hi Brice,

could you please start a new thread since this is a new problem with a new version of LibreOffice? It will make it easier to track. I'll mark this thread as resolved (in relation to the initial question :-) ).

Thanks, :-)

Denis