PDA

View Full Version : WuCheck



Tim Frost
02-06-2010, 10:11 AM
How do I incorporate WUCHECK?

I found where you put wupdate. It works fine but requires elevated permission. Therefore, I wanted to use wucheck. I cannot find anyway to incorportate wucheck into my setup so I just added the file to my file list. However, when I click on the file and try to run it nothing happens. Obviously, I am missing a step somewhere. What am I doing wrong?

Tim

linder
02-07-2010, 05:22 AM
Hi Tim,

See documentation (I have attached a screenshot of the relevant part) ;)

Friedrich

CMS Software
05-05-2010, 10:18 AM
Follow up question. Wucheck with /C or /c /s will return "1" if there is an update. HOW does it return the 1? Is it in SBReturnEX or do we use something like resultvar=wucheck.exe /c /s?

Secondly, with /C /S parameters, if there IS an update available, is it AUTOMATICALLY installed or do we use a script command to run wupdate.exe?

-ODW-

linder
05-05-2010, 10:33 AM
Hello,

It returns the code to the calling application.

See attached screenshot taken from the manual. /C /S checks for updates in silent mode. It does not download it if an update is available.

Does this help?

Friedrich

CMS Software
05-05-2010, 10:57 PM
Sorry, my question was not worded correctly. In a SetupBuilder routine I have the following line of code.

Run Program wucheck.exe /c /s (Always Install)

I understand that a "1" or a "0" will be returned to my SetupBuilder routine by wucheck.exe, I just don't see in the documentation HOW it is returned. I need to test to see if it is a one or a zero so that I can take the appropriate action. Which variable do I examine with SetupBuilder to determine which value was returned to my little SetupBuilder routine?

-O. D.-

linder
05-06-2010, 12:13 AM
Sorry, I fear I do not understand the "how it is returned" question. Is your question how to retrieve an exit code from a Windows application? If yes, are you a Visual Studio, Clarion, or Delphi programmer and which function (or Windows API) do you use to launch wucheck.exe?

The installer returns it like any other Windows application returns it. The exit code is set and your application (which calls wucheck.exe and waits for its termination) retrieves it. For example, if you use ShellExecuteEx to launch wucheck.exe and then WaitForSingleObject to wait for its termination, you simply use GetExitCodeProcess to retrieve the exit code. You do this with all Windows applications if you need the exit (return) code.

Does this help?

Friedrich

linder
05-06-2010, 12:19 AM
BTW, in your example:

Run Program wucheck.exe /c /s (Always Install)

"The %_SB_ERRORCODE% return value can also hold the last exit code returned by the executable associated with the work item on its last run."

So in this case, %_SB_ERRORCODE% would hold the retrieved exit code from wucheck.exe (make sure you have the "wait" option enabled).

Friedrich

CMS Software
05-06-2010, 11:29 AM
That's the answer I was looking for! When we call wucheck.exe from within a SetupBuilder generated exe, the result code is in the SB ErrorCode variable. Sorry I did not make this setup clear in my original question.

Since we are programming in Visual dBase and it is not trivial to run EXE files from dBase if you are concerned about the return codes, we just build utility routines in SB and let them handle the wucheck stuff for dBase. Thanks for your answer, now I am off to modify my SB wucheck utility.

-O. D.-