示例#1
0
        protected static bool IsInstalledRegistry(string program)
        {
            RegistryKey[] keys = new RegistryKey[] {
                Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"),
                Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"),
                Registry.ClassesRoot.OpenSubKey(@"Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages"),
            };

            return(keys.Any(key => key != null && CheckRegistryKey(key, "DisplayName", program)));
        }