Error 5005 with code 0x80070002 appears during software setup when the Windows Installer cannot find a required file, usually because a temporary folder is missing or a previous installation left incomplete data. The fix is to clear the Windows Installer cache and temporary folders, then rerun the setup as administrator. Below are the exact steps, the background on why this happens, and related troubleshooting for this common Windows error.
What the Error Code Means
The 0x80070002 code is a Windows error that translates to “The system cannot find the file specified.” When it appears as part of error 5005 during a setup, it means the installer (often an MSI package) is looking for a file that is not where it expects it to be. This can happen for several reasons:
- The Windows Installer cache folder (
C:\Windows\Installer) is corrupted or missing entries. - The user’s temporary folder (
%TEMP%) was cleared while the installer was still referencing it. - A previous version of the software left behind registry entries that point to old file paths.
- Antivirus software quarantined a needed setup file mid-installation.
Understanding the underlying cause helps you choose the right fix instead of blindly retrying the setup.
Why This Error Occurs
Windows Installer (the service that handles .msi files) relies on a cache of installation files stored in C:\Windows\Installer. When you run a setup that modifies an existing program, the installer may need to access a cached file from the original installation. If that file is missing (because the folder was cleaned, the disk was restored, or the cache was corrupted), the setup stops with error 5005 and the 0x80070002 code.
Another common scenario is when the setup program itself extracts files to a temporary directory and then tries to access them after the directory has been cleaned by a disk cleanup utility or a third-party cleaner. The error can also occur after a Windows update changes permissions on the installer folders, preventing the setup from reading the required files.
How to Fix Error 5005 0x80070002
Follow these steps in order. Most users resolve the issue with the first two steps.
- Clear the Windows Installer cache – Open File Explorer, go to
C:\Windows\Installer, and delete all files inside. You may need to take ownership of the folder first. Right-click the folder, select Properties, go to the Security tab, and give your user account Full Control. Then delete the contents. Be aware that this can affect the ability to uninstall or repair other programs, so only do this if you are comfortable with that risk. - Clear temporary files – Press
Win + R, type%temp%, and press Enter. Select all files in the folder and delete them. If some files are in use, skip them and continue. Also clear theC:\Windows\Tempfolder using the same method (you may need administrator rights). - Run the setup as administrator – Right-click the setup file and select “Run as administrator.” This gives the installer the necessary permissions to access protected folders.
- Disable antivirus temporarily – Some security software may block or quarantine installer files. Temporarily disable real-time protection, run the setup, then re-enable it. Do not disable your firewall.
- Use the Windows Installer CleanUp utility – Microsoft provides a tool called “Program Install and Uninstall Troubleshooter” that can fix corrupted installer entries. Download it from the official Microsoft website and run it. It will scan for issues and attempt to repair them.
- Repair the Windows Installer service – Open Command Prompt as administrator and run
msiexec /unregisterthenmsiexec /regserver. This re-registers the installer service.
Alternative Fix: Use System Restore
If the above steps do not work, you can try restoring your system to a point before the error started. System Restore can revert changes to Windows files and the registry without affecting your personal files. To do this:
- Press
Win + R, typerstrui, and press Enter. - Choose a restore point that predates the error (if available).
- Follow the prompts and restart your computer.
This is a good option if the error appeared after a recent system change, such as a Windows update or a driver installation.
Common Misconceptions
Many users think error 5005 means the setup file is corrupted, but that is rarely the case. The error is almost always about the system state, not the file itself. Re-downloading the setup file usually does not help. Another misconception is that the error is caused by a virus; while malware can damage installer files, the error is more often due to disk cleanup tools or manual deletion of the installer cache.
Also, some users believe that running the setup in Compatibility Mode will help. That is not a reliable fix for this specific error because the problem is not about the program’s compatibility with Windows, but about missing files in the installer’s working directories.
Frequently Asked Questions
Will clearing the Windows Installer cache break other programs?
Yes, it can. The cache is used to uninstall, repair, or update other installed programs. If you clear it, you may lose the ability to modify or remove some applications. It is a last-resort step. If possible, try the other fixes first, or back up the cache folder to another location before deleting its contents.
Can I fix this error without admin rights?
No, most of the fixes require administrator privileges because they involve system folders and services. If you are on a work or school computer, contact your IT department for help.
Why does this error happen only with certain programs?
Different programs use different installer technologies. Some rely heavily on the Windows Installer cache, while others use simpler self-contained installers. Programs that use MSI packages are more likely to trigger this error if the cache is damaged.
Is there a way to prevent this error in the future?
Yes, avoid using disk cleanup tools that delete the contents of C:\Windows\Installer. Also, do not manually delete files from that folder unless you are sure of what you are doing. Regularly running Windows Update and keeping your system healthy can reduce the chance of installer corruption.
Does this error affect Windows 10 and Windows 11 the same way?
Yes, the error code and the underlying cause are the same on both systems. The fix steps are essentially identical, though the exact path to some settings may differ slightly in the Settings app.
What if none of these fixes work?
If you have tried all the steps and the error persists, you may need to perform a repair installation of Windows (using the “Reset this PC” option that keeps your files) or contact the software vendor for support. In rare cases, a corrupted Windows component store can cause this error, and a repair install can resolve it.
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
- Photonic Inference vs GPU Inference: Key Differences16,384.00 µs
- Android Low Storage Survival Tips That Actually Work
- How to Password Protect PDFs on iPhone
- iPhone Force Restart Not Working? Fixes
- Add or Remove Keyboard Layout in Windows 10
- Razer Barracuda V2 Pro Dongle: Store & Find