I believe the best way is to explore the content of HKEY_CURRENT_USER\SOFTWARE\Clients which contains the folders of all programs installed in Windows.
What you want to do is use the Windows Registry command to fetch the proper folder and look inside for the install path.
Actually, it is HKEY_CURRENT_USER\SOFTWARE\ client being only one of the folders that leads to the default client, as outlined in the document pointed to by Eli. The key that contains all programs is HKEY_CURRENT_USER\\SOFTWARE\\