Client Automation - How can I register and distribute Windows Updates in MSU format?
search cancel

Client Automation - How can I register and distribute Windows Updates in MSU format?

book

Article ID: 10994

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Software Delivery

Issue/Introduction

  • Windows 7 and newer use MSU files for patches which are not imported directly in DSM-Explorer as is done with MSI files.
  • How can I register and distribute MSU patches to Agents?

Environment

CA-Client Automation - All versions
Windows 7 and newer

Resolution

A Package with the MSU file with a script to install it is needed as follows:

  • Create a Windows batch file (ie. install-msu.bat) in the same folder as the MSU file (see the following example). This will install the MSU in silent mode and do not prompt for reboot. As the log file from wusa.exe is in Event format evtx, it must be converted to text file so it can be viewed in the Job Output tab of the job. In this example we'll create a package for KB3133719:

    wusa.exe KB3133719-x64.msu.msu /quiet /norestart /log:%Temp%\wusa-KB3133719.evtx
    set rc=%ERRORLEVEL%
    WEVTUtil query-events %Temp%\wusa-KB3133719.evtx /lf:true /format:text /q:"*" > %1
    erase %Temp%\wusa-KB3133719.evtx
    exit %rc%

    In this script we run wusa.exe to install the patch and create a log file in evtx format and save the return code to end the script with it. Then, we convert the evtx log file to text format and copy it to the file referenced by %1 that will be the first parameter defined in the install procedure that will be $rf so the log can be reviewed in the Job Output tab of the job. Also deletes the temporary log file in evtx format.

 

  • Create a software package that includes the mentioned script together with the MSU file:

  • Create an Install procedure to run the install script and define $rf as the first parameter as follows ($#bg can also be added to run it in background):



  • Seal the package and deploy to the agents.

Additional Information

Full syntax of wusa.exe when called without parameters: