Page 1 of 1

WaptUpgrade sometimes inoperative

Published: June 24, 2016 - 3:09 PM
by eduret
Hello,
I'm writing to share a problem I haven't been able to diagnose yet.
I migrated from version 1.2.3 to 1.3.5 and added the waptupgrade package to all the machines being migrated. However, the update isn't working for everyone:
- there are no errors in the console, the package installed correctly (actually, the scheduled task registered successfully)
- the client is still on version 1.2.3.

By simulating the scheduled task on a problematic machine (Windows 8.1 -> excerpts are below), I noticed that the undocumented --temporary parameter is causing a bug.
Have you encountered this issue? Is it possible to remove this parameter without any side effects?
Thank you for your insights.

-> originally:
2016-06-24 13:55:24,260 INFO Run "('schtasks /Create /SC ONCE /TN "fullwaptupgrade" /TR "\'c:\\users\\eduret\\appdata\\local\\temp\\waptdeploy.exe\' --hash=84e175cf5f5318efbac05403b61e78c7175a039bd2e0422e563d4f317e04f1b6 --waptsetupurl=c:\\users\\eduret\\appdata\\local\\temp\\waptagent.exe --wait=15 --temporary --force --minversion=1.3.5.0" /ST 13:56:24 /RU SYSTEM /F /V1 /Z',)"

-> in simulation:
C:\wapt>c:\temp\waptdeploy.exe --hash=84e175cf5f5318efbac05403b61e78c7175a039bd2e0422e563d4f317e04f1b6 --waptsetupurl="c:\temp\waptagent.exe" --wait=15 --temporary --force --minversion=1.3.5.0
[..]
WAPT required version: 1.3.5.0
Wapt agent local path: C:\temp\c:\temp\waptagent.exe
Cleanup...
An unhandled exception occurred at $00416158:
EFOpenError: Unable to open file "C:\temp\c:\temp\waptagent.exe"

-> what works:
C:\wapt>c:\temp\waptdeploy.exe --hash=84e175cf5f5318efbac05403b61e78c7175a039bd2e0422e563d4f317e04f1b6 --waptsetupurl=c:\temp\waptagent.exe --wait=15 --force --minversion=1.3.5.0

ED

Re: WaptUpgrade sometimes not working

Published: June 24, 2016 - 4:29 PM
by htouvet
The `--temporary` parameter instructs waptdeploy to delete the `waptagent.exe` file after installation and to remove the scheduled task "fullwaptupgrade"
(see https://github.com/tranquilit/WAPT/blob ... y.lpr#L465).

If the `waptsetupurl` parameter contains a local path (not an HTTP URL), `waptagent.exe` must have already existed at the address specified by that path. If waptdeploy cannot find it, it assumes that `waptagent.exe` is in the same directory as waptdeploy.
In your case, it appears that `waptagent.exe` was not located at `c:\temp\waptagent.exe`, which is why waptdeploy attempted to add the `c:\temp` path, resulting in a duplicate.

Waptagent might not be able to find it at the temporary address during WaptUpgrade because an antivirus program might destroy it.
Waptagent.exe, compiled from the console, is not "signed" and is therefore sometimes considered suspicious.

During the WaptUpgrade package installation, Waptdeploy and Waptagent are copied to a shared system temporary directory, and a task is scheduled for a reboot.
During the copy to this temporary directory, the antivirus program might destroy Waptagent.exe (Waptdeploy, however, is signed).