Hello there, foru.
If you’re getting this error while installing your QuickBooks Desktop, you can perform the QuickBooks Install Diagnostic tool to fix the issue.
For the detailed steps on how to run this tool, please check this article: https://quickbooks.intuit.com/community/Getting-Started/Error-1904-2-failed-to-register-when-install....
You can also continue following the succeeding steps in the article if the Diagnostic tool won't work.
Feel free to post your questions again if there's anything else you need.