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)What do you think?
