PDA

View Full Version : wucheck and wupdate return -1



NewsArchive
10-19-2010, 12:05 AM
Hi Friedrich,

After updating a webupdate install to SB7 I'm getting both wupdate.exe and
wucheck returning -1 when I run them from my program (using ShellExecEx,
WaitforSingleObject and GetExitCodeProcess). However if I run wupdate.exe
it tells me, correctly, that there is a newer update. Any ideas? It
_could_ be my code but I have used this class without issues for years so I
don't know why it would have an issue with this...

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
10-19-2010, 12:05 AM
Hi Friedrich,

> _could_ be my code but I have used this class without issues for years so I
> don't know why it would have an issue with this...

This is rather unsettling: My code, using shellexecuteex etc. returns -1
but (clarion) Run() returns 1. Hmm... This will drive me nuts until I
figure out why the heck this is happening<g>

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
10-19-2010, 12:06 AM
Hi Friedrich,

> This is rather unsettling: My code, using shellexecuteex etc. returns -1
> but (clarion) Run() returns 1. Hmm... This will drive me nuts until I
> figure out why the heck this is happening<g>

Whew! Mystery solved! Run() will happily run "wucheck.exe" while
ShellExecEx requires a full path to it to work properly. I normally always
specify full path, but was lazy and thought this would work;) Apparently
it's like wucheck/wupdate don't check for the current path in case the path
is not part of the startup (or something) and can't find the app (which is
correct since it is looking for "wucheck.exe" not "C:\path\wucheck.exe") in
the registry and fails with -1 (which is also correct if the path is
missing). Interesting!

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
10-19-2010, 12:06 AM
Hi Arnór,

wucheck/wupdate do check for the current path.

The following line in the scripts handle it:

Set Variable %TMPPATH% to FUNCTION:Get System Info(Installer Path Name)

Friedrich

NewsArchive
10-22-2010, 02:09 AM
So what actually works correctly?

I was using valutilities vuRun and getting a "1" returned every time -
even though I created a batch file and wucheck is actually returning a "0"

I tried result = ITRun(runCommand, 1, ,,0) and had the same problem.
Do you have to separate the parameters from the command?

Paul Macfarlane

NewsArchive
10-22-2010, 02:10 AM
Hi Paul,

> I tried result = ITRun(runCommand, 1, ,,0) and had the same problem.
> Do you have to separate the parameters from the command?

Yes, with ITRun you must separate the parameters, the program parameter
cannot contain any parameters to the program. See
http://www.icetips.com/manuals/utilities/itrun_shellclass.htm

ITS.ITRun(ITS.ProgPath & '\wucheck.exe',True, '/C /S')

This works 100%.

ITS.ITRun('wucheck.exe',True, '/C /S')

on the other hand may not work correctly as it seems to trigger wucheck.exe
NOT to include the path to the app when looking for the app key in the
registry EVEN if it is being run in the correct path, i.e. PATH() is equal
to ITS.ProgPath.

So, make sure that you include the program path when using ITRun.

Best regards,


--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
10-22-2010, 02:10 AM
Thank you !

And doing.....

Result = ITS.ITRun(ITS.ProgPath & '\wucheck.exe',True, '/C /S')

Result (long) will be 0 (nothing new) or 1 (new version available)

Correct?

Paul Macfarlane

NewsArchive
10-22-2010, 02:11 AM
Hi Paul,

> Result = ITS.ITRun(ITS.ProgPath & '\wucheck.exe',True, '/C /S')
>
> Result (long) will be 0 (nothing new) or 1 (new version available)
>
> Correct?

Yes. ITRun uses GetExitCodeProcess API to get the exit code. This is only
triggered if the WAIT flag is specified as otherwise there is no reliable
exit code:)

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
10-22-2010, 02:11 AM
Got it working. Thanks for the tips and clarification.

Paul Macfarlane