Microsoft Office Update Error

Problem

You are trying to install or uninstall a patch associated with Ms Office but it fails showing any of the following errors:

  • 17031-Invalid baseline (Windows Installer)
  • 17302-Applying patch (MSoCache)
  • 17025-Patch already installed (file(s) version got updated)
  • 17028-No product installed for contained patch - Already Intalled / upgrade code missing.
  • 17044-Installer was unable to run detection for this package.

Cause

This might be due to missing installer files. Deletion of MSI files might take place due to any of the following reasons::

  • You might have deleted MSI files due to space constraints.
  • Third Party cleanup tools might have corrupted the installer files
  • Installation of anti-virus might have caused deletion of files

Resolution

Here are some of the methods to troubleshoot the issue:

  1. Check for ShellUi.Mst in your system
    ShellUI.Mst is a file associated with MSOffice for windows operating system. If windows cannot properly load the shellui.mst file due to any one of the above mentioned reasons, you can resolve this issue by:
    • First finding out if the installer file is present in the path: C:\Windows\Installer\{OfficeproductID}\ShellUI.MST"
    • If the file is not available in your machine, patch installation might fail with any of the office installer error code.
    • You can try to get this file from any of the other machines that is similar to that of the machine that has got the missing files.
  2. Troubleshoot using the OpUtils.vbs :
    Oputil.vbs is a script that helps in monitor, diagnose & troubleshoot an issue. It also helps in restoration of files.
    To troubleshoot using OpUtils.vbs, follow the steps given below:
    • Download the zip file from the following link  
    • Extract the zip file and get the file OpUtils.vbs to any location.
    • Run the command prompt as an administrator and navigate to the folder which the file OpUtils.vbs got saved.
    • Run the command : cscript OpUtil.vbs repair

    This will resolve some of the Cache issues related to office. This also will install the missing patches in the system.

  3. Restore installer files using Restore-Installer Files
    Some of the installer msi files that are missing on c:\windows\installer folder can be restored by backing up the machine or from any other machine having the similar software architecture.
    • Open the link 
    • Download the Restore-InstallerFiles.ps1 file
    • Go to the location where the file got downloaded and execute any of the following commands based on the backup mode by which you are retrieving the data:
      • If you want to restore installer files from a single or multiple machines to the affected machine:.\Restore-InstallerFiles -SourceMachine "Machine1", "Machine2", "Machine3";
      • If you want to restore installer files from the installer folders that exist in the local machine itself:.\Restore-InstallerFiles -SourceFolder "D:\InstallerFiles", "E:\InstallerFiles", "\\MachineX\D$\MSI Files";
      • If you want to restore all the files along with the logs of retrieving the file:.\Restore-InstallerFiles -SourceFolder "D:\InstallerFiles", "E:\InstallerFiles", "D:\InstallerFiles2" -LogFile "D:\Log.txt"; 
  4. Scan your systems using RoiScan(Robust Office Inventory Scan)
    It is an inventory scan performed by downloading a vbs script. The script scans your machine to find out the missing patches. A log file is created which is used to determine the missing MSI and MSP files.

    To scan the machine and find the missing patches follow the steps given below:

    • Download the script from here. You can get more information on RoiScan.vbs from this microsoft link.
    • Get the ROiScan.vbs file from the above link and run the command : cscript RoiScan.vbs
    • This will scan all over the machine and find the data related. All the log related to the RoiScan will be available at C:\Users\Administrator\AppData\Local\Temp\machine_name-RoiScan.log and C:\Users\Administrator\AppData\Local\Temp\machine_name-RoiScan.xml
  5. If the patch fails even after following all these steps, uninstall and reinstall Ms Office to resolve the issue.