diff --git a/ChangeLog.txt b/ChangeLog.txt index d3744d2..b6ded9b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -280,4 +280,9 @@ along with this program. If not, see . - Application Info scanner and uninstall manager use program info to get slow info cache - Added more checks for null or empty strings before checking for files/directories - No longer throws an exception when the path is null/empty in FileExists and DirExists() -- Checks for value name + others before being added to bad registry key array \ No newline at end of file +- Checks for value name + others before being added to bad registry key array +- Did some minor fixes to the ActiveX/COM scanner +- Changes to wait cursor when scanning +- Fixed bug causing duplicates in uninstall manager + ++ Version 1.3.1 Released \ No newline at end of file diff --git a/Common Tools/bin/Release/Common Tools.dll b/Common Tools/bin/Release/Common Tools.dll deleted file mode 100644 index 82ac820..0000000 Binary files a/Common Tools/bin/Release/Common Tools.dll and /dev/null differ diff --git a/Common Tools/bin/Release/Common Tools.pdb b/Common Tools/bin/Release/Common Tools.pdb deleted file mode 100644 index d0c0116..0000000 Binary files a/Common Tools/bin/Release/Common Tools.pdb and /dev/null differ diff --git a/Common Tools/obj/Release/Common Tools.csproj.FileListAbsolute.txt b/Common Tools/obj/Release/Common Tools.csproj.FileListAbsolute.txt index 5e64b41..0509bc2 100644 --- a/Common Tools/obj/Release/Common Tools.csproj.FileListAbsolute.txt +++ b/Common Tools/obj/Release/Common Tools.csproj.FileListAbsolute.txt @@ -5,11 +5,3 @@ C:\Users\Welcome\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\L C:\Users\Welcome\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common Tools.csproj.GenerateResource.Cache C:\Users\Welcome\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common Tools.dll C:\Users\Welcome\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common Tools.pdb -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\bin\Release\Common Tools.dll -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\bin\Release\Common Tools.pdb -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\ResolveAssemblyReference.cache -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common_Tools.Properties.Resources.resources -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common Tools.csproj.GenerateResource.Cache -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common Tools.dll -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common Tools.pdb -C:\Users\Nick\Documents\Visual Studio 2008\Projects\Little Registry Cleaner\Little Registry Cleaner\Common Tools\obj\Release\Common_Tools.DetailsRegView.resources diff --git a/Common Tools/obj/Release/Common Tools.csproj.GenerateResource.Cache b/Common Tools/obj/Release/Common Tools.csproj.GenerateResource.Cache deleted file mode 100644 index f30ca9f..0000000 Binary files a/Common Tools/obj/Release/Common Tools.csproj.GenerateResource.Cache and /dev/null differ diff --git a/Common Tools/obj/Release/Common Tools.dll b/Common Tools/obj/Release/Common Tools.dll deleted file mode 100644 index 82ac820..0000000 Binary files a/Common Tools/obj/Release/Common Tools.dll and /dev/null differ diff --git a/Common Tools/obj/Release/Common Tools.pdb b/Common Tools/obj/Release/Common Tools.pdb deleted file mode 100644 index d0c0116..0000000 Binary files a/Common Tools/obj/Release/Common Tools.pdb and /dev/null differ diff --git a/Common Tools/obj/Release/Common_Tools.DetailsRegView.resources b/Common Tools/obj/Release/Common_Tools.DetailsRegView.resources deleted file mode 100644 index 06c24d0..0000000 Binary files a/Common Tools/obj/Release/Common_Tools.DetailsRegView.resources and /dev/null differ diff --git a/Common Tools/obj/Release/Common_Tools.Properties.Resources.resources b/Common Tools/obj/Release/Common_Tools.Properties.Resources.resources deleted file mode 100644 index 08d17f3..0000000 Binary files a/Common Tools/obj/Release/Common_Tools.Properties.Resources.resources and /dev/null differ diff --git a/Common Tools/obj/Release/Refactor/Common Tools.dll b/Common Tools/obj/Release/Refactor/Common Tools.dll index 09e563c..9f2ff83 100644 Binary files a/Common Tools/obj/Release/Refactor/Common Tools.dll and b/Common Tools/obj/Release/Refactor/Common Tools.dll differ diff --git a/Little Registry Cleaner.chm b/Little Registry Cleaner.chm index cee647f..39ce3be 100644 Binary files a/Little Registry Cleaner.chm and b/Little Registry Cleaner.chm differ diff --git a/Misc/Utils.cs b/Misc/Utils.cs index d704670..7abbb49 100644 --- a/Misc/Utils.cs +++ b/Misc/Utils.cs @@ -803,8 +803,11 @@ private static VDTReturn ValidDriveType(string path) /// /// Sees if the file exists /// - /// The filename (including path) - /// True if it exists. Otherwise, false if the file path is empty or doesnt exist. + /// Always use this to check for files in the scanners! + /// The filename (including path) + /// + /// True if it exists or if the path should be skipped. Otherwise, false if the file path is empty or doesnt exist + /// public static bool FileExists(string filePath) { if (string.IsNullOrEmpty(filePath)) @@ -849,8 +852,9 @@ public static bool FileExists(string filePath) /// /// Sees if the directory exists /// + /// Always use this to check for directories in the scanners! /// The directory - /// True if it exists. Otherwise, false if the directory path is empty or doesnt exist. + /// True if it exists or if the path should be skipped. Otherwise, false if the file path is empty or doesnt exist public static bool DirExists(string dirPath) { if (string.IsNullOrEmpty(dirPath)) @@ -923,7 +927,6 @@ private static bool FindAnyIllegalChars(string path) return false; } - /// /// Uses the FindExecutable API to search for the file that opens the specified document /// diff --git a/Program.cs b/Program.cs index 96c4b1f..8aa23e2 100644 --- a/Program.cs +++ b/Program.cs @@ -77,7 +77,7 @@ static void Main() Properties.Settings.Default.strOptionsLogDir = string.Format("{0}\\Logs", Properties.Settings.Default.strProgramSettingsDir); if (!Directory.Exists(Properties.Settings.Default.strOptionsLogDir)) Directory.CreateDirectory(Properties.Settings.Default.strOptionsLogDir); - } + } //#if (!DEBUG) // Add event handler for thread exceptions diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 7654b85..ff62040 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.*")] -[assembly: AssemblyFileVersion("1.3")] +[assembly: AssemblyFileVersion("1.3.1")] diff --git a/ScanDlg.Designer.cs b/ScanDlg.Designer.cs index 8cf669e..e455944 100644 --- a/ScanDlg.Designer.cs +++ b/ScanDlg.Designer.cs @@ -109,6 +109,7 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(403, 129); this.Controls.Add(this.groupBox1); + this.Cursor = System.Windows.Forms.Cursors.WaitCursor; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; diff --git a/Scanners/AppInfo.cs b/Scanners/AppInfo.cs index 4fc81b0..62fe54a 100644 --- a/Scanners/AppInfo.cs +++ b/Scanners/AppInfo.cs @@ -75,17 +75,17 @@ public static void Scan() // Check display icon if (!string.IsNullOrEmpty(progInfo.DisplayIcon)) if (!Utils.IconExists(progInfo.DisplayIcon)) - ScanDlg.StoreInvalidKey("Invalid file or folder", regKey2.ToString(), "DisplayIcon"); + ScanDlg.StoreInvalidKey("Invalid file or folder", regKey2.ToString(), "DisplayIcon"); // Check install location if (!string.IsNullOrEmpty(progInfo.InstallLocation)) if ((!Utils.DirExists(progInfo.InstallLocation)) && (!Utils.FileExists(progInfo.InstallLocation))) - ScanDlg.StoreInvalidKey("Invalid file or folder", regKey2.ToString(), "InstallLocation"); + ScanDlg.StoreInvalidKey("Invalid file or folder", regKey2.ToString(), "InstallLocation"); // Check install source if (!string.IsNullOrEmpty(progInfo.InstallSource)) if ((!Utils.DirExists(progInfo.InstallSource)) && (!Utils.FileExists(progInfo.InstallSource))) - ScanDlg.StoreInvalidKey("Invalid file or folder", regKey2.ToString(), "InstallSource"); + ScanDlg.StoreInvalidKey("Invalid file or folder", regKey2.ToString(), "InstallSource"); // Check ARP Cache if (progInfo.SlowCache) diff --git a/Scanners/AppPaths.cs b/Scanners/AppPaths.cs index a04cea0..680f869 100644 --- a/Scanners/AppPaths.cs +++ b/Scanners/AppPaths.cs @@ -95,14 +95,8 @@ private static void ScanAppPaths() continue; } - if (ScanDlg.IsOnIgnoreList(strAppPath)) - continue; - if (!string.IsNullOrEmpty(strAppDir)) { - if (ScanDlg.IsOnIgnoreList(strAppDir)) - continue; - if (Utils.SearchPath(strAppPath, strAppDir)) continue; else if (Utils.SearchPath(strSubKey, strAppDir)) diff --git a/Scanners/COMObjects.cs b/Scanners/COMObjects.cs index 0b60689..97d5e60 100644 --- a/Scanners/COMObjects.cs +++ b/Scanners/COMObjects.cs @@ -64,7 +64,7 @@ public static void Scan() } // Scan file extensions + progids - ScanClasses (Registry.ClassesRoot); + ScanClasses(Registry.ClassesRoot); ScanClasses(Registry.LocalMachine.OpenSubKey("SOFTWARE\\Classes")); ScanClasses(Registry.CurrentUser.OpenSubKey("SOFTWARE\\Classes")); if (Utils.Is64BitOS) @@ -119,18 +119,24 @@ private static void ScanCLSIDSubKey(RegistryKey regKey) // Check for valid AppID string strAppID = regKey.GetValue("AppID") as string; if (!string.IsNullOrEmpty(strAppID)) - if (!AppIDExists(strAppID)) + if (!appidExists(strAppID)) ScanDlg.StoreInvalidKey("Missing AppID reference", rkCLSID.ToString(), "AppID"); // See if DefaultIcon exists - if (rkCLSID.OpenSubKey("DefaultIcon") != null) + using (RegistryKey regKeyDefaultIcon = rkCLSID.OpenSubKey("DefaultIcon")) { - Guid guid = Guid.Empty; - if (Utils.TryParseGuid(strCLSID, out guid)) + if (regKeyDefaultIcon != null) { - IntPtr icon = OleGetIconOfClass(ref guid, null, false); - if (icon == IntPtr.Zero) - ScanDlg.StoreInvalidKey("Unable to find icon", string.Format("{0}\\DefaultIcon", rkCLSID.ToString())); + Guid guid = Guid.Empty; + string iconPath = regKeyDefaultIcon.GetValue("") as string; + + if (Utils.TryParseGuid(strCLSID, out guid)) + { + IntPtr icon = OleGetIconOfClass(ref guid, null, false); + if (icon == IntPtr.Zero) + if (!ScanDlg.IsOnIgnoreList(iconPath)) + ScanDlg.StoreInvalidKey("Unable to find icon", string.Format("{0}\\DefaultIcon", rkCLSID.ToString())); + } } } @@ -175,8 +181,6 @@ private static void ScanCLSIDSubKey(RegistryKey regKey) /// private static void ScanAppIds(RegistryKey regKey) { - RegistryKey rkAppId = null; - if (regKey == null) return; @@ -184,18 +188,21 @@ private static void ScanAppIds(RegistryKey regKey) foreach (string strAppId in regKey.GetSubKeyNames()) { - if ((rkAppId = regKey.OpenSubKey(strAppId)) == null) - continue; - - // Update scan dialog - ScanDlg.UpdateScanningObject(rkAppId.ToString()); + using (RegistryKey rkAppId = regKey.OpenSubKey(strAppId)) + { + if (rkAppId != null) + { + // Update scan dialog + ScanDlg.UpdateScanningObject(rkAppId.ToString()); - // Check for reference to AppID - string strCLSID = rkAppId.GetValue("AppID") as string; + // Check for reference to AppID + string strCLSID = rkAppId.GetValue("AppID") as string; - if (!string.IsNullOrEmpty(strCLSID)) - if (!AppIDExists(strCLSID)) - ScanDlg.StoreInvalidKey("Missing AppID reference", rkAppId.ToString()); + if (!string.IsNullOrEmpty(strCLSID)) + if (!appidExists(strCLSID)) + ScanDlg.StoreInvalidKey("Missing AppID reference", rkAppId.ToString()); + } + } } regKey.Close(); @@ -226,7 +233,7 @@ private static void ScanClasses(RegistryKey regKey) string strProgID = rkFileExt.GetValue("") as string; if (!string.IsNullOrEmpty(strProgID)) - if (!ProgIDExists(strProgID)) + if (!progIDExists(strProgID)) ScanDlg.StoreInvalidKey("Missing ProgID reference", rkFileExt.ToString()); } } @@ -235,7 +242,7 @@ private static void ScanClasses(RegistryKey regKey) { Guid guid = Guid.Empty; if (CLSIDFromProgID(strSubKey, out guid) == 0) - if (!CLSIDExists(guid)) + if (!clsidExists(guid.ToString("B"))) ScanDlg.StoreInvalidKey("Missing CLSID reference", string.Format("{0}\\{1}", regKey.Name, strSubKey)); } @@ -265,10 +272,10 @@ private static void ScanExplorer() { Main.Logger.WriteLine("Checking for invalid browser helper objects"); - RegistryKey rkBHO = null; - if (regKey != null) { + RegistryKey rkBHO = null; + foreach (string strGuid in regKey.GetSubKeyNames()) { if ((rkBHO = regKey.OpenSubKey(strGuid)) != null) @@ -276,7 +283,7 @@ private static void ScanExplorer() // Update scan dialog ScanDlg.UpdateScanningObject(rkBHO.ToString()); - if (!CLSIDExists(strGuid)) + if (!clsidExists(strGuid)) ScanDlg.StoreInvalidKey("Missing CLSID reference", rkBHO.ToString()); } } @@ -363,11 +370,11 @@ private static void ValidateFileExt(RegistryKey regKey) // Parse and verify OpenWithProgId List using (RegistryKey rkProgids = regKey.OpenSubKey("OpenWithProgids")) { - if (rkProgids != null) + if (rkProgids != null) { foreach (string strProgid in rkProgids.GetValueNames()) { - if (ProgIDExists(strProgid)) + if (progIDExists(strProgid)) bProgidExists = true; } } @@ -385,10 +392,10 @@ private static void ValidateFileExt(RegistryKey regKey) string strApp = rkOpenList.GetValue(strValueName) as string; - if (ApplicationExists(strApp)) + if (appExists(strApp)) bAppExists = true; } - + } } @@ -405,55 +412,29 @@ private static void ValidateExplorerExt(RegistryKey regKey) // Sees if icon file exists string strHotIcon = regKey.GetValue("HotIcon") as string; if (!string.IsNullOrEmpty(strHotIcon)) - { if (!Utils.IconExists(strHotIcon)) - { - ScanDlg.StoreInvalidKey("Missing hot icon file", regKey.ToString()); - return; - } - } + ScanDlg.StoreInvalidKey("Missing hot icon file", regKey.ToString(), "HotIcon"); string strIcon = regKey.GetValue("Icon") as string; if (!string.IsNullOrEmpty(strIcon)) - { if (!Utils.IconExists(strIcon)) - { - ScanDlg.StoreInvalidKey("Missing icon file", regKey.ToString()); - return; - } - } + ScanDlg.StoreInvalidKey("Missing icon file", regKey.ToString(), "Icon"); // Lookup CLSID extension string strClsidExt = regKey.GetValue("ClsidExtension") as string; if (!string.IsNullOrEmpty(strClsidExt)) - { - if (!CLSIDExists(strClsidExt)) - { - ScanDlg.StoreInvalidKey("Missing CLSID Extension", regKey.ToString()); - return; - } - } + ScanDlg.StoreInvalidKey("Missing CLSID Extension", regKey.ToString(), "ClsidExtension"); // See if files exist string strExec = regKey.GetValue("Exec") as string; if (!string.IsNullOrEmpty(strExec)) - { if (!Utils.FileExists(strExec)) - { - ScanDlg.StoreInvalidKey("Missing executable", regKey.ToString()); - return; - } - } + ScanDlg.StoreInvalidKey("Missing executable", regKey.ToString(), "Exec"); string strScript = regKey.GetValue("Script") as string; if (!string.IsNullOrEmpty(strScript)) - { if (!Utils.FileExists(strScript)) - { - ScanDlg.StoreInvalidKey("Missing script file", regKey.ToString()); - return; - } - } + ScanDlg.StoreInvalidKey("Missing script file", regKey.ToString(), "Script"); } catch (System.Security.SecurityException ex) { @@ -468,8 +449,6 @@ private static void ValidateExplorerExt(RegistryKey regKey) /// False if Inprocserver is null or doesnt exist private static bool InprocServerExists(RegistryKey regKey) { - bool bRet = false; - try { if (regKey != null) @@ -482,9 +461,7 @@ private static bool InprocServerExists(RegistryKey regKey) if (!string.IsNullOrEmpty(strInprocServer)) if (Utils.FileExists(strInprocServer)) - bRet = true; - - regKeyInprocSrvr.Close(); + return true; } } @@ -496,9 +473,7 @@ private static bool InprocServerExists(RegistryKey regKey) if (!string.IsNullOrEmpty(strInprocServer32)) if (Utils.FileExists(strInprocServer32)) - bRet = true; - - regKeyInprocSrvr32.Close(); + return true; } } } @@ -508,12 +483,7 @@ private static bool InprocServerExists(RegistryKey regKey) System.Diagnostics.Debug.WriteLine(ex.Message); } - return bRet; - } - - private static bool IEToolbarIsValid(Guid guid) - { - return IEToolbarIsValid(guid.ToString("B")); + return false; } /// @@ -523,7 +493,7 @@ private static bool IEToolbarIsValid(string strGuid) { bool bRet = false; - if (!CLSIDExists(strGuid)) + if (!clsidExists(strGuid)) bRet = false; if (InprocServerExists(Registry.ClassesRoot.OpenSubKey("CLSID\\" + strGuid))) @@ -551,119 +521,120 @@ private static bool IEToolbarIsValid(string strGuid) } /// - /// Checks if application sub key exists + /// Sees if application exists /// - /// Application name - /// True if app exists - private static bool ApplicationExists(string strApp) + /// Application Name + /// True if it exists + private static bool appExists(string appName) { - try - { - if (Registry.ClassesRoot.OpenSubKey(@"Applications\" + strApp) != null) - return true; + List listRegKeys = new List(); - if (Registry.LocalMachine.OpenSubKey(@"Software\Classes\Applications\" + strApp) != null) - return true; + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey("Applications")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Classes\Applications")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Classes\Applications")); - if (Registry.CurrentUser.OpenSubKey(@"Software\Classes\Applications\" + strApp) != null) - return true; + if (Utils.Is64BitOS) + { + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey(@"Wow6432Node\Applications")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Classes\Applications")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Wow6432Node\Classes\Applications")); + } - if (Utils.Is64BitOS) + try + { + foreach (RegistryKey rk in listRegKeys) { - if (Registry.ClassesRoot.OpenSubKey(@"Wow6432Node\Applications\" + strApp) != null) - return true; - - if (Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Classes\Applications\" + strApp) != null) - return true; - - if (Registry.CurrentUser.OpenSubKey(@"Software\Wow6432Node\Classes\Applications\" + strApp) != null) - return true; + using (RegistryKey subKey = rk.OpenSubKey(appName)) + { + if (subKey != null) + if (!ScanDlg.IsOnIgnoreList(subKey.ToString())) + return true; + } } } - catch (System.Security.SecurityException ex) + catch { - System.Diagnostics.Debug.WriteLine(ex.Message); + return false; } return false; } - private static bool CLSIDExists(Guid guid) - { - return CLSIDExists(guid.ToString("B")); - } - /// /// Sees if the specified CLSID exists /// - /// The CLSID GUID + /// The CLSID GUID /// True if it exists - private static bool CLSIDExists(string strGuid) + private static bool clsidExists(string clsid) { - try - { - if (Registry.ClassesRoot.OpenSubKey("CLSID\\" + strGuid) != null) - return true; + List listRegKeys = new List(); - if (Registry.LocalMachine.OpenSubKey("Software\\Classes\\CLSID\\" + strGuid) != null) - return true; + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey("CLSID")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Classes\CLSID")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Classes\CLSID")); - if (Registry.CurrentUser.OpenSubKey("Software\\Classes\\CLSID\\" + strGuid) != null) - return true; + if (Utils.Is64BitOS) + { + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey(@"Wow6432Node\CLSID")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Classes\CLSID")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Wow6432Node\Classes\CLSID")); + } - if (Utils.Is64BitOS) + try + { + foreach (RegistryKey rk in listRegKeys) { - if (Registry.ClassesRoot.OpenSubKey("Wow6432Node\\CLSID\\" + strGuid) != null) - return true; - - if (Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\Classes\\CLSID\\" + strGuid) != null) - return true; - - if (Registry.CurrentUser.OpenSubKey("Software\\Wow6432Node\\Classes\\CLSID\\" + strGuid) != null) - return true; + using (RegistryKey subKey = rk.OpenSubKey(clsid)) + { + if (subKey != null) + if (!ScanDlg.IsOnIgnoreList(subKey.ToString())) + return true; + } } } - catch (System.Security.SecurityException ex) + catch { - System.Diagnostics.Debug.WriteLine(ex.Message); + return false; } return false; } /// - /// Checks if the ProgID exists + /// Checks if the ProgID exists in Classes subkey /// - /// The ProgID + /// The ProgID /// True if it exists - private static bool ProgIDExists(string strProgID) + private static bool progIDExists(string progID) { - try - { - if (Registry.ClassesRoot.OpenSubKey(strProgID) != null) - return true; + List listRegKeys = new List(); - if (Registry.LocalMachine.OpenSubKey("Software\\Classes\\" + strProgID) != null) - return true; + listRegKeys.Add(Registry.ClassesRoot); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Classes")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Classes")); - if (Registry.CurrentUser.OpenSubKey("Software\\Classes\\" + strProgID) != null) - return true; + if (Utils.Is64BitOS) + { + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey(@"Wow6432Node")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Classes")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Wow6432Node\Classes")); + } - if (Utils.Is64BitOS) + try + { + foreach (RegistryKey rk in listRegKeys) { - if (Registry.ClassesRoot.OpenSubKey("Wow6432Node\\" + strProgID) != null) - return true; - - if (Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\Classes\\" + strProgID) != null) - return true; - - if (Registry.CurrentUser.OpenSubKey("Software\\Wow6432Node\\Classes\\" + strProgID) != null) - return true; + using (RegistryKey subKey = rk.OpenSubKey(progID)) + { + if (subKey != null) + if (!ScanDlg.IsOnIgnoreList(subKey.ToString())) + return true; + } } } - catch (System.Security.SecurityException ex) + catch { - System.Diagnostics.Debug.WriteLine(ex.Message); + return false; } return false; @@ -672,41 +643,44 @@ private static bool ProgIDExists(string strProgID) /// /// Checks if the AppID exists /// - /// The AppID or GUID + /// The AppID or GUID /// True if it exists - private static bool AppIDExists(string strAppId) + private static bool appidExists(string appID) { - try - { - if (Registry.ClassesRoot.OpenSubKey("AppID\\" + strAppId) != null) - return true; + List listRegKeys = new List(); - if (Registry.LocalMachine.OpenSubKey("SOFTWARE\\Classes\\AppID\\" + strAppId) != null) - return true; + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey(@"AppID")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Classes\AppID")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Classes\AppID")); - if (Registry.CurrentUser.OpenSubKey("SOFTWARE\\Classes\\AppID\\" + strAppId) != null) - return true; + if (Utils.Is64BitOS) + { + listRegKeys.Add(Registry.ClassesRoot.OpenSubKey(@"Wow6432Node\AppID")); + listRegKeys.Add(Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Classes\AppID")); + listRegKeys.Add(Registry.CurrentUser.OpenSubKey(@"Software\Wow6432Node\Classes\AppID")); + } - if (Utils.Is64BitOS) + try + { + foreach (RegistryKey rk in listRegKeys) { - if (Registry.ClassesRoot.OpenSubKey("Wow6432Node\\AppID\\" + strAppId) != null) - return true; - - if (Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\Classes\\AppID\\" + strAppId) != null) - return true; - - if (Registry.CurrentUser.OpenSubKey("Software\\Wow6432Node\\Classes\\AppID\\" + strAppId) != null) - return true; + using (RegistryKey subKey = rk.OpenSubKey(appID)) + { + if (subKey != null) + if (!ScanDlg.IsOnIgnoreList(subKey.ToString())) + return true; + } } } - catch (System.Security.SecurityException ex) + catch { - System.Diagnostics.Debug.WriteLine(ex.Message); + return false; } return false; } + #endregion } } \ No newline at end of file diff --git a/Scanners/Drivers.cs b/Scanners/Drivers.cs index 1fec3a1..8e41ff6 100644 --- a/Scanners/Drivers.cs +++ b/Scanners/Drivers.cs @@ -53,10 +53,8 @@ public static void Scan() ScanDlg.UpdateScanningObject(strValue); if (!string.IsNullOrEmpty(strValue)) - { if (!Utils.FileExists(strValue)) ScanDlg.StoreInvalidKey("Invalid file or folder", regKey.Name, strDriverName); - } } regKey.Close(); diff --git a/UninstallManager/UninstallManager.cs b/UninstallManager/UninstallManager.cs index 4bbffa9..2548176 100644 --- a/UninstallManager/UninstallManager.cs +++ b/UninstallManager/UninstallManager.cs @@ -33,7 +33,7 @@ namespace Little_Registry_Cleaner.UninstallManager { public partial class UninstallManager : Form { - private static ProgramList arrProgList = new ProgramList(); + private ProgramList arrProgList = new ProgramList(); private int nSortColumn = -1; public UninstallManager() diff --git a/bin/Debug/Little Registry Cleaner.exe b/bin/Debug/Little Registry Cleaner.exe index 0a6c536..a8bbcef 100644 Binary files a/bin/Debug/Little Registry Cleaner.exe and b/bin/Debug/Little Registry Cleaner.exe differ diff --git a/bin/Debug/Little Registry Cleaner.pdb b/bin/Debug/Little Registry Cleaner.pdb index 6814e5f..dbf0f49 100644 Binary files a/bin/Debug/Little Registry Cleaner.pdb and b/bin/Debug/Little Registry Cleaner.pdb differ diff --git a/bin/Release/Common Tools.pdb b/bin/Release/Common Tools.pdb deleted file mode 100644 index d0c0116..0000000 Binary files a/bin/Release/Common Tools.pdb and /dev/null differ diff --git a/bin/Release/Little Registry Cleaner.pdb b/bin/Release/Little Registry Cleaner.pdb deleted file mode 100644 index ee31d33..0000000 Binary files a/bin/Release/Little Registry Cleaner.pdb and /dev/null differ