You can us the below generic code to get the installation path of SDL Tridion (it looks you are using SDL Tridion 2011 as specified by the question tag) regardless of the fact whether you are using a 32-bit OS or 64-Bit OS:
private string GetTridionInstallPath()
{
string output = string.Empty;
string regKeyPath = string.Empty;
if (Environment.Is64BitOperatingSystem)
{
regKeyPath = @"Software\Wow6432Node\Tridion";
}
else
{
regKeyPath = @"Software\Tridion";
}
RegistryKey regKey = Registry.LocalMachine.OpenSubKey(regKeyPath);
output = regKey.GetValue("InstallDir").ToString();
return output;
}
I hope it helps