3 Replies Latest reply on Feb 10, 2014 11:34 AM by Lawrence Garvin

    Patch Managment Newbie questions on WUA error handling

    bkao

      As a developer interested in getting the most out of Windows Update Agent API to install MS updates, I am encountering the following questions whenever I cannot use WUAApiLib.dll to install certain "stupborn" updates. Bear with me as I am new to Thwack and patch management. If this type of questions are already covered in other threads/FAQ within Thwack/PM or at Microsoft please kindly post the pointers. Thanks in advance.

       

       

      Q1. Is there a list of all the possible format/fileext of MS updates/install tools and  that I can get directly from Microsoft?

      if exe        then c:\>file.exe  /quiet /norestart

      else if cab   then c:\>pkgmgr /w /ip /quiet /noreboot /m: ( or dism)

      else if msi   then c:\>msiexec /q /i

      else if msu   then c:\>wusa /quiet /norestart

       

      Q2. If WUA API fails to install, is there a universal way to re-try pro grammatically, that is suitable all OS (from XP to windows 8.1)?

       

      Q3.  Out of all the ~1000 wua error codes, which ones worth retrying installation by means of IUpdateInstaller2.CreateUpdateInstaller.Install()?

       

      http://inetexplorer.mvps.org/archive/windows_update_codes.htm

       

      Q4. Other than windowsupdate.log and cbs.logs, is there other logs that cannot be missed?

       

      The above questions assume relatively modern WUA versioning, no virus, already restarted all relative services (Windows Installer, Windows Update, TrustedInstaller, no reboot pending due to already installed updates etc. )

       

      Thanks in advance.

      Ben

        • Re: Patch Managment Newbie questions on WUA error handling
          Lawrence Garvin

          The best resource to use for programming against the Windows Update Agent API is the MSDN Library:

          Windows Update Agent API (Windows)

          Q1. Is there a list of all the possible format/fileext of MS updates/install tools and  that I can get directly from Microsoft?

          It's a very short list. The Microsoft Update infrastructure supports three installation file formats: EXE, MSI, and MSP.

          It should not be necessary for you to build logic to lauch the installation handlers, as that capability already exists internal to the Windows Update Agent.

          When the WUAgent obtains an update package from WU/MU/WSUS, it notes the type of installer (EXE, MSI, MSP) and lauches the appropriate install handler.

          Q2. If WUA API fails to install, is there a universal way to re-try pro grammatically, that is suitable all OS (from XP to windows 8.1)?

          I'm not quite understanding this question. I don't believe what you wrote is what you're actually intending to ask.

          However, if an update installation fails when launched by the Windows Update Agent, there are two scenarios in which the installation will be re-launched:

          • The WUAgent is configured with AUOption='4' and a ScheduledInstallationDay/ScheduledInstallationTime, in which case the WUAgent will attempt another installation at the next scheduled installation event, provided that the update package is still available to the client for installation.
          • A logged on user launches an update installation from the Control Panel -> Windows Update applet.

          Q3.  Out of all the ~1000 wua error codes, which ones worth retrying installation by means of IUpdateInstaller2.CreateUpdateInstaller.Install()?

          The WUAgent error codes are irrelevant to this question. The installer returns a result code to the Windows Update Agent. The update package defines how to handle the result codes that are returned. If the WUAgent does not receive a success result code or a success reboot pending result code, it considers the installation to have failed.

           

          The WUAgent error codes cited at the webpage are returned when the *WUA* fails to perform as expected, e.g. cannot communicate with WU/MU/WSUS.

          Q4. Other than windowsupdate.log and cbs.logs, is there other logs that cannot be missed?

          No.

            • Re: Patch Managment Newbie questions on WUA error handling
              bkao

              hi Lawrence

              Thanks for your quick reply.

               

              In fact what made me asked  Q2/3  is ( thanks for your clarification).

               

              -- when I use wuaapi, i am running into this error on this particular MS-update

              0x80242004 WU_E_UH_DOESNOTSUPPORTACTION A request for the handler to install (uninstall) an update could not be completed because the update does not support install (uninstall).

               

              --

              Title[Windows Server 2008 R2 Service Pack 1 x64 Edition (KB976932)] Guid[c23ca405-0655-40a1-97de-44920d6fca35] Revision[101]

              mpsyschk_6b99e1e5d80fd534553accdee972f7f4b3df3eb3.exe]

              spclite_7816025072eef79650ec499f674ec88c2edc0ff1.exe]

              windows6.1-kb976932-x64_d8f1b1ffcb12b91c6d9e886939c71e2f5adb0b0f.cab]

              spreview_f83face33cf77bc7f96ecdc950e7157a42767bee.exe]

               

               

              I have tried to look up for this error code in MSDN but do not know how to install this MS-update using wuaapi ( tried after reboot and  CreateUpdateInstaller() with ForceQuiet and IsForced attribute already.)

               

              This seems to be happening only on certain MSmachines (windows 2008 R2) only.  When I manually install ( not using wuaapi) on this windows 2008 R2's cmd using /quiet I am able to install successfully.  I am not using wsus.

               

              What puzzle me is

              -- can wuaapi always able to install ALL ms-updates?

              -- what can I do within wuaapi if I get one of these error msg like 0x80242004 WU_E_UH_DOESNOTSUPPORTACTION? Do I need to install manually?

                • Re: Patch Managment Newbie questions on WUA error handling
                  Lawrence Garvin
                  0x80242004 WU_E_UH_DOESNOTSUPPORTACTION A request for the handler to install (uninstall) an update could not be completed because the update does not support install (uninstall).

                  That seems pretty straightforward. What did you define in the package you tried to select?

                   

                  Title[Windows Server 2008 R2 Service Pack 1 x64 Edition

                   

                  What kind of system are you trying to install this onto?

                  Is the WS2008R2 SP1 package approved for a group containing this system?

                  Does this system show the update as *NEEDED* in the WSUS console?

                  What puzzle me is

                  -- can wuaapi always able to install ALL ms-updates?

                  Provided the updates are approved for the correct group, and the binaries are downloaded to the WSUS server.

                  What happens if you scan using the Control Panel -> Windows Update applet?

                  -- what can I do within wuaapi if I get one of these error msg like 0x80242004 WU_E_UH_DOESNOTSUPPORTACTION? Do I need to install manually?

                  You can't really "do" anything except diagnose why the WUA doesn't like the package.