Have you restarted your machine?
If not then please restart the machine. It is strongly required. After restarting the machine, try to run SharePoint setup, it will install without any error.
After restarting the machine if still it gives same error then follow the below steps:
Check the value of the following Registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\UpdateExeVolatile
- if the value of the UpdateExeVolatile Registry key is anything other than 0 you will see this message.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
- if the PendingFileRenameOperations Registry key has any value you will see this message.
To remove an orphaned UpdateExeVolatile registry key value
- Open a registry editor, such as Regedit.exe or Regedt32.exe.
- Navigate to HKLM\SOFTWARE\Microsoft\Updates\
- In the right navigation pane, double-click the UpdateExeVolatile key.
- Configure the key with a value of 0
- Close Registry Editor.
To delete the orphaned PendingFileRenameOperations registry key
- Open a registry editor, such as Regedit.exe or Regedt32.exe.
- Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\
- In the right navigation pane, right-click the PendingFileRenameOperations key and selectDelete.
- Close Registry Editor.
Delete the InProgress registry value
- Open a registry editor, such as Regedit.exe or Regedt32.exe.
- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer.
- Right-click the InProgress value and select Delete from the context menu. When prompted, click Yes to confirm the delete operation.
- Close Registry Editor.
Restart your computer and attempt to run the installation again.