I'm developing a simple win32 tool. I'd the tool to be easily uninstalled by the user so I've added a subkey to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
called MyTool
and added all the necessary keys such as: DisplayName
,UninstallString
,DisplayVersion
,DisplayIcon
So far so good. I can see that during the install process of my tool, the new subkey was added and everything is as expected.
When I come to uninstall my tool and press uninstall I get the following error:
You do not have sufficient access to uninstall MyTool. Please contact your system administrator
My process is 32 bit. However, Wow6432Node
related topic is irrelevant since I've encounter this issue both in 32 & 64 bit systems.
Did I do something wrong with the way I've added the registry subkey?
This is the kind of time-wasting bugs that are so stupid.
The issue was, believe it or not, the path separator used in key's value: UninstallString
.
"C:/Program Files (x86)/MyTool/my_tool.exe" /uninstall"
"C:\Program Files (x86)\MyTool\my_tool.exe" /uninstall
Regardless of whether or not it is my fault as a developer, why would windows error out in this case?