If this problem happens then it may be a result of failing pending changes to the Windows OS. These file changes are listed in a registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\

under DWORD:

PendingFileRenameOperation

I would suggest first renaming this DWORD value, with the prefix “OLD_” or something similar and then attempting the un/install again.

If there were some unexpected results in renaming the file it is trivial to remove the prefix and restore the system but best practice would include an entire registry export prior to fiddling!

http://www.davegernon.co.uk/techblog/export-windows-registry/