When installing QTP/UFT you select to install Microsoft Script Debugger.
Now MS removed it from their site.
see here for solution (download and install it manually)
the file name is scd10en.exe/zip so you can search for it yourself.
This Utility clean the Windows\Installer folder and may also solve installation problems with MSI
(Replace by MS Fix-it: https://support.microsoft.com/en-us/mats/program_install_and_uninstall