public static UninstallInfo Find(string appName)
{
var uninstall = Registry.CurrentUser.OpenSubKey(UninstallRegistryPath);
if (uninstall == null) return null;
return (from app in uninstall.GetSubKeyNames() let sub = uninstall.OpenSubKey(app)
where sub != null && sub.GetValue("DisplayName") as string == appName
select new UninstallInfo
{
Key = app,
UninstallString = sub.GetValue("UninstallString") as string,
ShortcutFolderName = sub.GetValue("ShortcutFolderName") as string,
ShortcutSuiteName = sub.GetValue("ShortcutSuiteName") as string,
ShortcutFileName = sub.GetValue("ShortcutFileName") as string,
SupportShortcutFileName = sub.GetValue("SupportShortcutFileName") as string,
Version = sub.GetValue("DisplayVersion") as string
}).FirstOrDefault();
}