I'm attempting to install a driver on a client machine based on which version of MySQL is installed on the server and to do that I'd like to check the version on the server via registry key.
That said, I need to enumerate the subkey(s) of HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB
. There is usually just one key under this one and it is generally of the form: MySQL Server #.#
, where # stands for a number.
But because I don't know which value those are, is there a way to get the key and then I can get the numbers from the name to determine which driver to install? I'm thinking that enumerating the subkeys is the best way to get the key, but perhaps a clever string formatting and loop would work too?