Page 1 of 1

[SOLVED] Package creation problem (wapt is not defined)

Published: November 15, 2024 - 1:33 PM
by Marceld
Hello everyone,

I am currently experiencing a problem with the "wapt.install" function.

I am trying to launch a WAPT packet depending on the type of PC I am facing.
Everything works as expected except for the target packet call:

The script in question:

Code: Select all

from setuphelpers import *

import wmi

c = wmi.WMI()

def install():

    for computer in c.Win32_ComputerSystem():
        print(f"Marque: {computer.Manufacturer}")
        if computer.Manufacturer == "Dell Inc.":
            print(f"C'est un Dell je lance le paquet dell")
            wapt.install('dell-command-update-uwp')
        elif computer.Manufacturer == "Lenovo":
            print(f"C'est un Lenovo je lance le paquet Lenovo")
            wapt.install('lenovo-system-update')
        else:
            print(f"marque non reconnu")

Code: Select all

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4235, in install_wapt
    exitstatus = setup.install()
  File "C:\waptdev\scm-drivers-constructeur_0_PROD-wapt\setup.py", line 14, in install
    wapt.install('dell-command-update-uwp')
NameError: name 'wapt' is not defined

The wapt.install function is normally called in setuphelpers, if I understand correctly, right?
For "wapt.install" I was inspired by one of your recommendations viewtopic.php?t=3681 Perhaps it's no longer functional?

Thanks in advance

WAPT version: 2.5.5.15697
OS: Ubuntu 22.04 LTS
Client OS: W10 22H2

Re: Problem creating package (wapt is not defined)

Published: November 15, 2024 - 1:39 PM
by sfonteneau
You can try with WAPT in uppercase ;) ?

Re: Problem creating package (wapt is not defined)

Published: November 15, 2024 - 2:23 PM
by Marceld
sfonteneau wrote: Nov 15, 2024 - 1:39 PM Could you try with WAPT in uppercase ;) ?
I suspected it would be that simple :roll: But I hadn't been able to find any resources on this specific topic.

It works now. Thank you very much.
Have a good weekend