Hi @Martin zheng ,
sqlmgmproviderxpsp2up.mof is located at C:\Program Files (x86)\Microsoft SQL Server\150**Shared**. Please check this again in your environment.
Please uninstall the previous failed installation then run an new installation again.
Quote from the blog Error: "The MOF compiler could not connect with the WMI server".
Please open a command prompt as administrator and run the following command:
mofcomp "%programfiles(x86)%\Microsoft SQL Server\150 \Shared\sqlmgmproviderxpsp2up.mof"
Then open the Services control panel, restart the Windows Management Instrumentation service, and then do a manual install of the SQL. Use a new instance or run an uninstall of the previous instance and then make a "fresh" install.
If it is not work, please check if this similar thread could help you. And please share us SQL server setup log for analysis.
If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.