Page 1 of 1

Frequent checks for updates and enabling postponement

Published: November 23, 2016 - 9:00 PM
by f4242
Hello,

I'm currently using UpdatEngine and I'm considering replacing it with something else, as I find it inflexible for our needs. WAPT seems to meet most of the requirements on my checklist, with one exception.

With UpdatEngine, it checks for updates every 30 minutes and then deploys them (it doesn't wait for the computer to shut down). I use the PowerShell App Deployment Toolkit in my deployment script to display a dialog box to the user asking them to close the application I'm about to install. The user can also postpone the installation up to 10 times. Once this limit is reached, the user can no longer postpone and the installation is forced.

After reading the documentation, I don't think I can do this kind of thing with WAPT. Am I mistaken?

Thank you!

Re: Frequent checks for updates and enabling postponement

Published: November 25, 2016 - 12:03 AM
by sfonteneau
Hello,

I've just created a test package that tries to reproduce the behavior you described (more or less)

: - Every 30 minutes, an update is performed, and if no one is connected to the machine, an upgrade is initiated.
- At session startup, an update/upgrade is performed.
- Then, once the session is open, an update is still performed every 30 minutes, and if an update is available, a popup will appear asking if the installation should be launched.
- Every 30 minutes, the popup will reappear.
- After 10 refusals, the installation will be forced!

https://wapt.lesfourmisduweb.org/wapt/e ... 4_all.wapt

Warning! This is a test package!

Re: Frequent checks for updates and enabling postponement

Published: November 25, 2016 - 4:22 PM
by f4242
Interesting. I'll test this in the next few days and get back to you.

Thanks!

Re: Frequent checks for updates and enabling postponement

Published: January 11, 2017 - 7:09 PM
by f4242
Hi,

I didn't use the package as is, but I drew heavily on it to help me create my own implementation. The problem I saw with this implementation is that it doesn't display a list of applications to the user that they need to close.

So, I built a package that performs the following operations:

* Creates a scheduled task that starts when the computer boots and is repeated every 30 minutes. This task runs a cmd script that simply performs a `wapt-get update` and a `wapt-get upgrade`.

* Deploys a subdirectory in C:\wapt\. This directory contains the files necessary to run a PowerShell App Deployment Toolkit (PSADT) script. This script takes as input the name of the application to be updated, its version, and the list of processes that need to be stopped. If one of the processes is running, the user is prompted to quit it, with the option to postpone the action up to 10 times.

I created a custom_setuphelpers.py file where I created a copy of the install_exe_if_needed, install_msi_if_needed, and killalltasks functions. The function names are prefixed with "custom_". The install* functions are identical to the original except that I call the custom_killalltasks function instead. The custom_killalltasks function executes my PSADT script instead of killing the processes itself.

Finally, my deployment packages are slightly modified:

I import custom_setuphelpers instead of setuphelpers.
I call my custom installation functions instead of the original functions.

It works exactly as I want!

If I may make a suggestion, take a look at what PSADT (http://psappdeploytoolkit.com/) does and consider the possibility of properly integrating it into WAPT. You can do some pretty advanced things (impose a specific deadline, a limit on the number of postponements, prevent an update if PowerPoint is in presentation mode, etc.). It's much safer than killing the process without warning!

I hope my post will be helpful to others.

Have a good day!