Fixing Installation fails: #Installation ended prematurely because of an error” in Windows 10.
You can try to install or reinstall the #program in a Clean #Boot State or restart the #Windows Installer Service.
You could also try to re-register the Windows #Installer Service or re-register the VBScript. dll file.
https://outsourcepath.com/resource/windows-error-installation-ended-prematurely-because-of-an-error