Hi @Aqib Jamshed ,
How did you uninstall your SQL server instance? Please follow the steps from this MS document to uninstall SQL 2019 instance. If you are unable to uninstall SQL Server completely because you deleted SQL Server files and un-installation is giving error please follow below method.
- Uninstall the existing SQL Server and all the components from the add remove program.
- Backup the registry.
- Delete the following keys using regedit:
o--HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
o--HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer - Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and delete all the sub-keys referencing SQL Server.
- Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and delete all the keys referencing SQL Server.
- Rename all the SQL Server folders in the computer.
- Reboot the machine.
Refer to the Uninstall and Fresh install parts from this blog to get detail information.
The installation error message that you offered is too less for analysis, please share us the SQL server 2019 setup log(summary and detail) for analysis. Please read the detail log, you may find which file that the system could not found. The setup log is located at C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log\20220414_123517 as the screenshot mentioned.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".