Exit codes of windows patches

(imported topic written by sinucus)

I’m trying to capture the exit code of the wusa.exe process but I’m running into some difficulty. Basically the problem that I’m having is some patches just don’t like to be installed on our systems and it is causing a problem. They usually have some specific exit code like, Exit Code=-2145124329. In these situations I’d like to act upon it. So for example, I run this command and I get back the following in the client log.

Command started - waithidden “C:\Windows\SysWOW64\wusa.exe” “C:\debugger__BESData__Download\wusa.msu” /quiet /norestart

Command succeeded (Exit Code=-2145124329) waithidden “C:\Windows\SysWOW64\wusa.exe” “C:\debugger__BESData__Download\wusa.msu” /quiet /norestart

I’d then like to capture, but here is what happens

appendfile “Exit_Code”="{exit code of action}"

Command succeeded appendfile “Exit_Code”=“41792417”

Any ideas?

(imported comment written by sinucus)

help? I really would like to know if you can take action on the exit codes within the action. Even when the exit code is 0, I still get those crazy exit codes of 41 million, and they change each time as well.

(imported comment written by jgstew)

This does seem odd

Does it change anything if it includes “as string”? :

appendfile “Exit_Code”="{exit code of action as string}"

(imported comment written by sinucus)

Well, that got me started down the right path. I ran the following the fixlet debugger. Two different results, but neither “0”. So thinking that it must work, I tried using the native client.

STATUS: Running action…

Command started - waithidden cmd.exe /C

Command succeeded (Exit Code=0) waithidden cmd.exe /C

Command succeeded appendfile “Exit_Code”=“2308788”

Command succeeded appendfile “Exit_Code”=“41691601”

— Result —

Evaluation completed successfully!

Sure enough, the native client worked perfectly.

Command started - waithidden cmd.exe /C (action:35170)

At 10:24:42 -0800 - actionsite (http://tivoli:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Exit Code=0) waithidden cmd.exe /C (action:35170)

At 10:24:45 -0800 - actionsite (http://tivoli:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded appendfile “Exit_Code”="{exit code of action as string}" (action:35170)

Command succeeded (file created) appendfile “Exit_Code”=“0” (action:35170)

Command succeeded appendfile “Exit_Code”=“0” (action:35170)

Command succeeded appendfile “Exit_Code”=“0” (action:35170)

At 10:24:45 -0800 -

ActionLogMessage: (action:35170) ending action

Looks like the Fixlet debugger does not handle exit codes properly.

(imported comment written by jgstew)

That does seem likely. I don’t trust the debugger when I run into issues like this and always test in the console / client to compare results. I still find the debugger helpful and a quick way to get started, but it is definitely lacking.