When you install or reinstall a program on Windows, the setup may stop with a fatal error, say that the installation failed, or show “Installation ended prematurely because of an error”. Most of the time, something left behind by a previous uninstall is causing it.
When programs are uninstalled, they leave files behind. If the uninstall was not complete, the next installation can fail with this error.
“Installation ended prematurely because of an error” is a generic Windows Installer error. It can happen with any software installation or reinstallation, so the fixes below also work for similar installation errors. This tutorial applies to computers, laptops, desktops and tablets running Windows 10, Windows 8 and Windows 7.
Update (October 2026): Windows 10 support ended on October 14, 2025, and Windows 7 and 8 are no longer supported either. The commands below also work on Windows 11.
In this article
Fix 1: Re-register Windows Installer
- Right-click the Start button and select Windows PowerShell (Admin) (on Windows 11: Terminal (Admin)).
- Run these two commands, one after the other. Press Enter after each line:
msiexec /unreg
msiexec /regserver
These commands usually don’t show any message, and that is normal.
Fix 2: Re-register VBScript
Many installers use VBScript during setup. If its file is not registered correctly, the installation can stop with this error.
- Type cmd in the search box, right-click Command Prompt and select Run as administrator.
- Run this command:
regsvr32 vbscript.dll
You should see a message that DllRegisterServer in vbscript.dll succeeded.
Step 3: Restart your PC and try again
You have to restart the PC after running the commands. Then try to install the software again.
Still not working? Try these
- Run the installer as administrator: right-click the setup file and select Run as administrator.
- Check the Windows Installer service: press Windows + R, type
services.mscand press Enter. Double-click Windows Installer. If the startup type is Disabled, set it to Manual and click OK. - Remove the leftovers of the old installation: on Windows 10, Microsoft’s Program Install and Uninstall troubleshooter can fix problems that block programs from being installed or removed. You can find it on Microsoft’s page Fix problems that block programs from being installed or removed.
Does a program fail to start after installing, with a missing DLL message? See how to fix the “VCRUNTIME140.dll is missing” error.




