Why does Registry.DoesKeyExist() product a error line in the setup log when the key you are looking for does not exist. This seems to defeat the purpose of the function, which I think is to test whether the key exists so that it can be referenced without causing a error?
Announcement
Collapse
No announcement yet.
Registry.DoesKeyExist
Collapse
X
-
I don't see this. With this sample code
Code:if not Registry.DoesKeyExist(HKEY_CURRENT_USER, "Something") then SetupData.WriteToLogFile("Info\tHKCU\\Something does not exist\r\n", true); end if not Registry.DoesKeyExist(HKEY_CURRENT_USER, "Something\\Anything") then SetupData.WriteToLogFile("Info\tHKCU\\Something\\Anything does not exist\r\n", true); end if not Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Something") then SetupData.WriteToLogFile("Info\tHKLM\\Something does not exist\r\n", true); end if not Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Something\\Anything") then SetupData.WriteToLogFile("Info\tHKLM\\Something\\Anything does not exist\r\n", true); end
Code:... [10/29/2013 16:33:57] Notice Start project event: On Startup [10/29/2013 16:33:57] Info HKCU\Something does not exist [10/29/2013 16:33:57] Info HKCU\Something\Anything does not exist [10/29/2013 16:33:57] Info HKLM\Something does not exist [10/29/2013 16:33:57] Info HKLM\Something\Anything does not exist [10/29/2013 16:33:57] Success Run project event: On Startup ...
Ulrich
Comment