diff --git a/SteamCleaner/Clients/Gog.cs b/SteamCleaner/Clients/Gog.cs index a532be5..66a153e 100644 --- a/SteamCleaner/Clients/Gog.cs +++ b/SteamCleaner/Clients/Gog.cs @@ -15,14 +15,40 @@ internal class Gog { public static bool Exisit() { - var root = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\GOG.com\Games"); + var regPath = ""; + var is64Bit = Environment.Is64BitOperatingSystem; + if (is64Bit) + { + Console.WriteLine("64 Bit operating system detected"); + regPath = @"SOFTWARE\Wow6432Node\GOG.com\Games"; + } + else + { + Console.WriteLine("32 Bit operating system detected"); + regPath = @"SOFTWARE\GOG.com\Games"; + } + + var root = Registry.LocalMachine.OpenSubKey(regPath); return root != null; } public static List GetGames() { var paths = new List(); - var root = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\GOG.com\Games"); + var regPath = ""; + var is64Bit = Environment.Is64BitOperatingSystem; + if (is64Bit) + { + Console.WriteLine("64 Bit operating system detected"); + regPath = @"SOFTWARE\Wow6432Node\GOG.com\Games"; + } + else + { + Console.WriteLine("32 Bit operating system detected"); + regPath = @"SOFTWARE\GOG.com\Games"; + } + + var root = Registry.LocalMachine.OpenSubKey(regPath); if (root != null) paths.AddRange( root.GetSubKeyNames() diff --git a/SteamCleaner/Clients/Origin.cs b/SteamCleaner/Clients/Origin.cs index 873173c..c98758c 100644 --- a/SteamCleaner/Clients/Origin.cs +++ b/SteamCleaner/Clients/Origin.cs @@ -1,5 +1,6 @@ #region +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -13,7 +14,20 @@ internal class Origin { public static bool Exist() { - var key = Registry.LocalMachine.OpenSubKey(@"Software\Origin"); + var regPath = ""; + var is64Bit = Environment.Is64BitOperatingSystem; + if (is64Bit) + { + Console.WriteLine("64 Bit operating system detected"); + regPath = @"Software\Wow6432Node\Origin"; + } + else + { + Console.WriteLine("32 Bit operating system detected"); + regPath = @"Software\Origin"; + } + + var key = Registry.LocalMachine.OpenSubKey(regPath); return key?.GetValue("ClientPath") != null; } @@ -21,7 +35,20 @@ public static List GetGames() { if (!Exist()) return null; var paths = new List(); - var root = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Electronic Arts"); + var regPath = ""; + var is64Bit = Environment.Is64BitOperatingSystem; + if (is64Bit) + { + Console.WriteLine("64 Bit operating system detected"); + regPath = @"SOFTWARE\Wow6432Node\Electronic Arts"; + } + else + { + Console.WriteLine("32 Bit operating system detected"); + regPath = @"SOFTWARE\Electronic Arts"; + } + + var root = Registry.LocalMachine.OpenSubKey(regPath); if (root != null) paths.AddRange( root.GetSubKeyNames() @@ -30,8 +57,17 @@ public static List GetGames() .Select(key => key.GetValue(@"Install Dir")) .Select(o => o?.ToString()) .Where(Directory.Exists)); - - var legacyRoot = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\EA Games"); + if (is64Bit) + { + Console.WriteLine("64 Bit operating system detected"); + regPath = @"SOFTWARE\Wow6432Node\EA Games"; + } + else + { + Console.WriteLine("32 Bit operating system detected"); + regPath = @"SOFTWARE\EA Games"; + } + var legacyRoot = Registry.LocalMachine.OpenSubKey(regPath); if (legacyRoot != null) paths.AddRange( legacyRoot.GetSubKeyNames() diff --git a/SteamCleaner/Clients/Steam.cs b/SteamCleaner/Clients/Steam.cs index 8b71759..f202c49 100644 --- a/SteamCleaner/Clients/Steam.cs +++ b/SteamCleaner/Clients/Steam.cs @@ -22,8 +22,21 @@ public static string FixPath(string dir) public static string GetSteamPath() { + var regPath = ""; var steamPath = ""; - var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Valve\Steam"); + var is64Bit = Environment.Is64BitOperatingSystem; + if (is64Bit) + { + Console.WriteLine("64 Bit operating system detected"); + regPath = "SOFTWARE\\Wow6432Node\\Valve\\Steam"; + } + else + { + Console.WriteLine("32 Bit operating system detected"); + regPath = "SOFTWARE\\Valve\\Steam"; + } + + var key = Registry.LocalMachine.OpenSubKey(regPath); if (key != null) { var o = key.GetValue("InstallPath"); diff --git a/SteamCleaner/Properties/AssemblyInfo.cs b/SteamCleaner/Properties/AssemblyInfo.cs index e8f16a1..c84420c 100644 --- a/SteamCleaner/Properties/AssemblyInfo.cs +++ b/SteamCleaner/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ // associated with an assembly. [assembly: AssemblyTitle("SteamCleaner")] -[assembly: AssemblyDescription("Free up space on your PC from all those pesky redistributables left by Steam")] +[assembly: AssemblyDescription("A PC utility for restoring disk space from various game like Origin, Steam and GoG")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SteamCleaner")] @@ -39,5 +39,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.0.0")] -[assembly: AssemblyFileVersion("1.5.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.0.0")] +[assembly: AssemblyFileVersion("1.6.0.0")] \ No newline at end of file diff --git a/SteamCleaner/SteamCleaner.csproj b/SteamCleaner/SteamCleaner.csproj index f21002d..6c536fc 100644 --- a/SteamCleaner/SteamCleaner.csproj +++ b/SteamCleaner/SteamCleaner.csproj @@ -34,6 +34,7 @@ TRACE prompt 4 + false noun_131514_cc.ico diff --git a/version.xml b/version.xml index 0606d7f..5204dc9 100644 --- a/version.xml +++ b/version.xml @@ -1,5 +1,5 @@ - 1.5 + 1.6 https://github.com/Codeusa/SteamCleaner/releases/latest