Browse Source

Experiment for issue #37

deadmoon 4 years ago
parent
commit
e92140bb0d
3 changed files with 28 additions and 21 deletions
  1. 3 3
      Optimizer/Program.cs
  2. 25 18
      Optimizer/Utilities.cs
  3. BIN
      lab/Optimizer-TryBuild.exe

+ 3 - 3
Optimizer/Program.cs

@@ -12,10 +12,10 @@ namespace Optimizer
 
 
         // Enter current version here
         // Enter current version here
 
 
-        internal readonly static float Major = 7;
-        internal readonly static float Minor = 8;
+        internal readonly static float Major = 0;
+        internal readonly static float Minor = 0;
 
 
-        internal readonly static bool EXPERIMENTAL_BUILD = false;
+        internal readonly static bool EXPERIMENTAL_BUILD = true;
 
 
         internal static string GetCurrentVersionTostring()
         internal static string GetCurrentVersionTostring()
         {
         {

+ 25 - 18
Optimizer/Utilities.cs

@@ -301,31 +301,38 @@ namespace Optimizer
 
 
             if (hive != null)
             if (hive != null)
             {
             {
-                RegistryKey key = hive.OpenSubKey(keyPath, true);
-
-                if (key != null)
+                try
                 {
                 {
-                    string[] valueNames = key.GetValueNames();
+                    RegistryKey key = hive.OpenSubKey(keyPath, true);
 
 
-                    foreach (string x in valueNames)
+                    if (key != null)
                     {
                     {
-                        try
-                        {
-                            RegistryStartupItem item = new RegistryStartupItem();
-                            item.Name = x;
-                            item.FileLocation = key.GetValue(x).ToString();
-                            item.Key = key;
-                            item.RegistryLocation = location;
-                            item.StartupType = type;
-
-                            list.Add(item);
-                        }
-                        catch (Exception ex)
+                        string[] valueNames = key.GetValueNames();
+
+                        foreach (string x in valueNames)
                         {
                         {
-                            ErrorLogger.LogError("Utilities.GetRegistryStartupItemsHelper", ex.Message, ex.StackTrace);
+                            try
+                            {
+                                RegistryStartupItem item = new RegistryStartupItem();
+                                item.Name = x;
+                                item.FileLocation = key.GetValue(x).ToString();
+                                item.Key = key;
+                                item.RegistryLocation = location;
+                                item.StartupType = type;
+
+                                list.Add(item);
+                            }
+                            catch (Exception ex)
+                            {
+                                ErrorLogger.LogError("Utilities.GetRegistryStartupItemsHelper", ex.Message, ex.StackTrace);
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
+                catch (Exception ex)
+                {
+                    ErrorLogger.LogError("Utilities.GetRegistryStartupItemsHelper", ex.Message, ex.StackTrace);
+                }
             }
             }
         }
         }
 
 

BIN
lab/Optimizer-TryBuild.exe