Consideration of the hp-image-assistant package

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Answer
Olivier Schmitt
Messages: 44
Registration: Oct 22, 2024 - 1:25 p.m.

March 6, 2025 - 3:26 PM

Good morning,

I wanted to share this thought with you.

https://wapt.tranquil.it/store/fr/tis-h ... -assistant

This package contains the application of a scheduled task that goes beyond simply installing the tool.
Indeed, when applying such a package, one expects the tool to be installed.
Here we go further by applying an update policy that is specific to an environment that wants it and that already stems from a reflection and implementation of the tool.

It seems more appropriate to separate the installation and configuration into two separate packages.

Therefore, the package should only contain the installation files, i.e.:

Code: Select all

def install():
    print('Vérification de la marque de l\'ordinateur...')

    if Vendor.find('HP') != -1:
        app_dir = makepath(programdata,"HP","HPIA")

        if isdir(app_dir):
            killalltasks(ensure_list(control.impacted_process))
            #Wait for process to end
            time.sleep(5)
            remove_tree(app_dir)

        bin_name = glob.glob("hp-hpia*.exe")[0]
        mkdirs(app_dir)

        run(
            bin_name + f" /s /e /f \"{app_dir}\"",
            accept_returncodes = [0, 3010, 1168]
        )
    else:
        print('Ce n\'est pas un PC HP...')

Et un autre paquet pour:

       print('copie des fichiers')
        mkdirs('C:\Windows\Wapt\HPIA')
        filecopyto('HPIA.ps1','C:\Windows\Wapt\HPIA')
        filecopyto('HPIA.xml','C:\Windows\Wapt\HPIA')

        print('création de la tâche planifiée')
        if not task_exists(task_name):
            run(r'schtasks /create /xml C:\Windows\Wapt\HPIA\HPIA.xml /tn HPIA')
        else:
            print("task %s exist and is active" % task_name)
The same applies to the adaptation of the uninstall and audit.

What do you think?
Benbatt
Messages: 10
Registration: June 19, 2024 - 7:08 PM

March 11, 2025 - 06:35

Hi. :D
In itself, you could end up with incorrect information about the PC type. As for checking via a scheduled task, I'm not really in favor of that.
You could modify the setup if you want to deploy it on machines whose manufacturer you don't know, using PowerShell or Bash to detect and handle the audit errors, if you see what I mean.

However, if it's for machines that are never on your network, a scheduled task is appropriate.
Olivier Schmitt
Messages: 44
Registration: Oct 22, 2024 - 1:25 p.m.

March 11, 2025 - 1:43 PM

Hello,

I don't quite understand your feedback.
Logically, the scheduled task should indeed be removed from this package.
Answer