サーバーにインストールされているMySQLのバージョンに基づいてクライアントマシンにドライバーをインストールしようとしています。そのために、レジストリキーを使用してサーバーのバージョンを確認します。
そうは言っても、のサブキーを列挙する必要がありHKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB
ます。通常、このキーの下にはキーが1つだけあり、通常は次の形式になりますMySQL Server #.#
。ここで、#は数字を表します。
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?