Esempio n. 1
0
        private static List <EDrawingInstall> GetEDrawingsInstallations()
        {
            List <EDrawingInstall> installations = new List <EDrawingInstall>();

            using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
            {
                foreach (string subkey_name in key.GetSubKeyNames())
                {
                    using (RegistryKey subkey = key.OpenSubKey(subkey_name))
                    {
                        if (subkey.GetValue("DisplayName") != null)
                        {
                            if (subkey.GetValue("DisplayName").ToString().Contains("eDrawing"))
                            {
                                installations.Add(new EDrawingInstall {
                                    Name    = subkey.GetValue("DisplayName").ToString(),
                                    Install = subkey.GetValue("InstallLocation").ToString(),
                                    Year    = EDrawingInstall.GetYear(subkey.GetValue("DisplayName").ToString())
                                });
                            }
                        }
                    }
                }
            }

            return(installations);
        }