Exemple #1
0
 private void RefreshEntries(RefreshManager <UninstallerDataObject> manager, RegistryKey rootKey, string keyName)
 {
     using (RegistryKey hkKey = rootKey.OpenSubKey(keyName, false))
     {
         foreach (string subKeyName in hkKey.GetSubKeyNames())
         {
             string keyPath = string.Format("{0}\\{1}", keyName, subKeyName);
             UninstallerDataObject mdo;
             try
             {
                 if (manager.Contains(subKeyName, out mdo))
                 {
                     mdo.Refresh(rootKey, keyPath, subKeyName);
                 }
                 else
                 {
                     mdo = new UninstallerDataObject(rootKey, keyPath, subKeyName);
                     if (!string.IsNullOrEmpty(mdo.ApplicationName))
                     {
                         manager.Objects.Add(mdo);
                     }
                 }
             }
             catch (Exception e)
             {
                 Log.Error(string.Format("unable to analyse registry key {0}", keyPath), e);
             }
         }
     }
 }
Exemple #2
0
 public UninstallerProperties(UninstallerDataObject udo)
 {
     InitializeComponent();
     First = true;
     UDO   = udo;
     ModifiedForeground   = new SolidColorBrush(Colors.Blue);
     UnmodifiedForeground = new SolidColorBrush(Colors.Black);
 }
 public UninstallerProperties(UninstallerDataObject udo)
 {
     InitializeComponent();
     First = true;
     UDO = udo;
     ModifiedForeground = new SolidColorBrush(Colors.Blue);
     UnmodifiedForeground = new SolidColorBrush(Colors.Black);
 }
        private void RefreshEntries(RefreshManager<UninstallerDataObject> manager, RegistryKey rootKey, string keyName)
        {
            using(RegistryKey hkKey = rootKey.OpenSubKey(keyName,false))
            {
                foreach (string subKeyName in hkKey.GetSubKeyNames())
                {
                    string keyPath = string.Format("{0}\\{1}", keyName, subKeyName);
                    UninstallerDataObject mdo;
                    try
                    {
                        if (manager.Contains(subKeyName, out mdo))
                        {
                            mdo.Refresh(rootKey, keyPath, subKeyName);
                        }
                        else
                        {
                            mdo = new UninstallerDataObject(rootKey, keyPath, subKeyName);
                            if (!string.IsNullOrEmpty(mdo.ApplicationName))
                            {
                                manager.Objects.Add(mdo);
                            }
                        }
                    }
                    catch(Exception e)
                    {
                        Log.Error(string.Format("unable to analyse registry key {0}", keyPath), e);
                    }

                }
            }
        }