Page 1 of 1

Consideration of the hp-image-assistant package

Published: March 6, 2025 - 3:26 PM
by Olivier Schmitt
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?

Re: Consideration of the hp-image-assistant package

Published: March 11, 2025 - 06:35
by Benbatt
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.

Re: Consideration of the hp-image-assistant package

Published: March 11, 2025 - 1:43 PM
by Olivier Schmitt
Hello,

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