命名空间引用:Microsoft.Win32;
RegistryKey appPath = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\"+你要取的软件的
执行程序.exe);
Console.WriteLine(appPath.GetValue(string.Empty).ToString());//取exe路径(x:\xxx\xxx.exe)
Console.WriteLine(appPath.GetValue("Path").ToString());//取exe所在目录(x:\xxx\xxx\)
PS:不是所有软件都会在AppPath中注册,所以该方法不是所有软件的安装路径都能取。当然如果你要去更新的那个软件也是你写的,就在安装过程中注册AppPath即可。