Page 1 of 1

[SOLVED] Launching the equivalent of the wapt-get command in a package

Published: June 14, 2024 - 09:30
by tux
Hello,

I'd like to perform the equivalent of the following two commands in a Python package:
`wapt-get -u -f upgrade`
and `wapt-get waptwua-install`.

I can't find anything in the "Setuphelpers for Windows" documentation, and using the `run` function doesn't seem to complete the process.

What functions should I use?

Thank you in advance.

Re: Launching the equivalent of the wapt-get command in a package

Published: June 14, 2024 - 12:51
by sfonteneau
Good morning

In the `def install()` function, you have a WAPT object available that represents the WAPT engine

https://www.wapt.fr/fr/doc/wapt-create- ... pt-package

Code: Select all


from common import WaptWUA

def install():
    WAPT.install('tis-firefox-esr')

    wc = WaptWUA(WAPT)
    wc.install_updates()


Re: Launching the equivalent of the wapt-get command in a package

Published: June 14, 2024 - 1:56 PM
by tux
Hello,

thank you for the feedback.

I assume the WAPT object is an implementation of the Wapt class, which is in common.py?

Re: Launching the equivalent of the wapt-get command in a package

Published: June 14, 2024 - 2:07 PM
by sfonteneau
This is the Wapt class from common.py, already instantiated (this is the Wapt engine, already instantiated)

Re: [SOLVED] Launching the equivalent of the wapt-get command in a package

Published: June 17, 2024 - 09:41
by dcardon
Hi Sébastien,

to add to Simon's answer, I wanted to point out that WAPT.install() requires access to the WAPT repository to be available when def install() is run. This is often not the case with laptops connected via VPN in a user session or with 802.1x machines.

We're considering adding a WAPT.add_package_as_needed() function that could add the package as a local dependency so it's installed even if the connection isn't available when def install() is run.

Regards,

Denis