sodcalculator

10 Tech How-To

Fix Error 0x8007139f on Windows 11

Guide 10-33310 · Updated · Step by step

Error 0x8007139f on Windows 11 typically appears when you try to install, update, or uninstall a program, and it means the Windows Installer service cannot access the required installation source or registry key. The fix usually involves clearing the installer cache, repairing the Windows Installer service, or using the built-in troubleshooter. Below is a step-by-step guide to resolve it, plus background on why it happens and how to prevent it.

What Causes Error 0x8007139f?

This error code is part of the Windows Installer (MSI) error set. It translates to ERROR_INSTALL_PACKAGE_INVALID, meaning the installation package is not recognized as a valid MSI or MST file, or the system cannot read the package metadata. Common triggers include:

  • A corrupted or incomplete downloaded installer file.
  • Broken registry entries left by a previous uninstall or failed update.
  • Antivirus or security software blocking the installer from accessing system folders.
  • Outdated Windows Installer service or missing system files.
  • User account permission issues, especially if you are not running as administrator.

While the error often appears when installing a new app, it can also surface during Windows Update or when repairing an existing program. Knowing the exact context helps you choose the right fix.

Before You Start: Basic Checks

Try these quick steps first, as they resolve many cases without deeper troubleshooting:

  1. Restart your PC. A fresh boot clears temporary locks on installer files.
  2. Run the installer as administrator. Right-click the setup file and select Run as administrator.
  3. Disable your antivirus temporarily (if safe) and try again. Some security suites block MSI packages.
  4. Ensure you have enough free disk space, especially on the C: drive.
  5. Check that the downloaded file is complete by comparing its size with the official source.

If the error persists, move to the system-level fixes below.

Method 1: Use the Windows Installer Troubleshooter

Microsoft provides a dedicated troubleshooter for installer problems. It automates many common repairs.

  1. Download the Microsoft Program Install and Uninstall Troubleshooter from the official Microsoft website (search for it if you don’t have the link).
  2. Run the tool and accept the license terms.
  3. Select Troubleshooting and then choose Installing or Uninstalling depending on your situation.
  4. Follow the prompts. The tool may detect and fix issues with the Windows Installer service or registry.

This tool is not a guarantee, but it is a quick, safe first step. If it reports no issues, proceed to manual fixes.

Method 2: Repair the Windows Installer Service

The Windows Installer (msiserver) service must be running and set to automatic. Here’s how to verify and restart it:

  1. Press Win + R, type services.msc, and press Enter.
  2. Scroll to Windows Installer. Double-click it.
  3. Set Startup type to Automatic (if not already).
  4. If the service is not running, click Start. If it is running, click Stop then Start again.
  5. Click Apply and OK.

Sometimes the service is disabled by a policy or a third-party tool. Check the Log on tab to ensure it uses the Local System account. If the service fails to start, you may need to run the System File Checker (SFC) to repair corrupted system files.

Method 3: Clear the Installer Cache and Repair Registry

A corrupted installer cache can cause this error. The cache is stored in C:\Windows\Installer and contains MSI files used for updates and repairs. Do not delete the entire folder – that can break many installed programs. Instead, use the built-in msiexec command to re-register the installer:

  1. Open Command Prompt as administrator (search for cmd, right-click, and select Run as administrator).
  2. Run the following commands one by one, pressing Enter after each:
    msiexec /unregister
    msiexec /regserver
  3. Restart your PC.

This re-registers the Windows Installer service in the registry. If you suspect a specific installer file is corrupted, try downloading it again from the official source instead of using a cached copy.

Method 4: Run System File Checker and DISM

Corrupted system files can cause the installer to fail. Use the built-in tools to repair them:

  1. Open Command Prompt as administrator.
  2. Run sfc /scannow and wait for it to complete. This scans and repairs protected system files.
  3. If SFC finds issues it cannot fix, run DISM /Online /Cleanup-Image /RestoreHealth. This repairs the Windows image.
  4. Restart your PC after both commands finish.

These tools can take 10-20 minutes. Do not interrupt them. After the repair, try installing your program again.

Method 5: Check User Account Control and Permissions

If you are using a standard (non-admin) account, the installer may not have permission to write to protected folders. Even with an admin account, UAC can block certain operations.

  • Right-click the installer file and select Run as administrator.
  • If the error persists, temporarily disable UAC (slider to Never notify) and try again. Re-enable UAC immediately after – leaving it off reduces security.
  • Ensure the folder where you are installing to has full read/write permissions for your user account.

If you are installing for all users, you must have administrative rights. Some enterprise environments enforce restrictions via Group Policy – contact your IT admin if this applies.

Frequently Asked Questions

Why does error 0x8007139f appear only for certain programs?

It usually means that specific program’s installer package is corrupted or incompatible with your system. It could also be a leftover registry entry from an old version. Try uninstalling any previous version first, then download a fresh installer from the official website.

Can I ignore this error and continue using the program?

If the error appears during installation, the program is likely not installed correctly. Using a partially installed program can cause crashes or security vulnerabilities. It is best to resolve the error before using the software.

Does this error affect Windows Update?

Yes, it can appear when updating certain Windows components that rely on MSI packages. The same fixes apply – run the Windows Update troubleshooter, then the SFC and DISM commands if needed.

Will resetting Windows fix the error?

Resetting Windows (keeping your files) can fix deep system corruption, but it is a last resort. Try all the methods above first. If you do reset, back up your data and note that installed programs will be removed.

Is it safe to delete the C:\Windows\Installer folder?

No. That folder contains cached MSI files needed to update, repair, or uninstall many programs. Deleting it can break those programs. Only delete specific files if you are certain they are orphaned, and even then, use a dedicated cleanup tool rather than manual deletion.

What if none of these fixes work?

If the error persists, consider creating a new local administrator account and trying the installation from there. You can also use System Restore to revert to a point before the error started. If the problem affects multiple programs, a repair installation of Windows 11 (using the Media Creation Tool) may be necessary.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →