From 85deefccef881508502c7ee09c1376b7f38760ca Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 15 Jan 2016 20:07:44 -0500 Subject: [PATCH] Fixes #19 #17 --- SteamCleaner/Clients/Steam.cs | 7 ++++++- SteamCleaner/MainWindowViewModel.cs | 6 ++++-- SteamCleaner/Properties/AssemblyInfo.cs | 4 ++-- SteamCleaner/Utilities/CleanerUtilities.cs | 2 +- version.xml | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/SteamCleaner/Clients/Steam.cs b/SteamCleaner/Clients/Steam.cs index f202c49..5e3f6e8 100644 --- a/SteamCleaner/Clients/Steam.cs +++ b/SteamCleaner/Clients/Steam.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; +using MaterialDesignThemes.Wpf; using Microsoft.Win32; #endregion @@ -61,11 +62,15 @@ public static int CountOccurences(string needle, string haystack) public static List GetSecondarySteamInstallPaths() { + var paths = new List(); var configPath = GetSteamPath() + "\\config\\config.vdf"; + if (!File.Exists(configPath)) + { + return paths; + } var data = File.ReadAllText(configPath); var numberOfInstallPaths = CountOccurences("BaseInstallFolder", data); var dataArray = File.ReadAllLines(configPath); - var paths = new List(); for (var i = 0; i < numberOfInstallPaths; i++) { var slot = i + 1; diff --git a/SteamCleaner/MainWindowViewModel.cs b/SteamCleaner/MainWindowViewModel.cs index d78c944..bc5438f 100644 --- a/SteamCleaner/MainWindowViewModel.cs +++ b/SteamCleaner/MainWindowViewModel.cs @@ -2,9 +2,11 @@ using System.Collections.ObjectModel; using System.ComponentModel; +using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Windows.Input; +using SquaredInfinity.Foundation.Extensions; using SteamCleaner.Clients; using SteamCleaner.Utilities; @@ -57,8 +59,8 @@ private void RunRefresh() //needs to be called to ensure we aren't loading a previously stored object. CleanerUtilities.updateRedistributables = true; _pathsInternal.Clear(); - foreach (var steamPath in Steam.SteamPaths()) - _pathsInternal.Add(steamPath); + var steamPaths = Steam.SteamPaths(); + _pathsInternal.AddRange(steamPaths.Select(steamPath => Steam.FixPath(steamPath)).Where(path => Directory.Exists(path)).ToList()); if (Gog.Exisit()) { _pathsInternal.Add("GoG Games Detected"); diff --git a/SteamCleaner/Properties/AssemblyInfo.cs b/SteamCleaner/Properties/AssemblyInfo.cs index 2208e16..009c215 100644 --- a/SteamCleaner/Properties/AssemblyInfo.cs +++ b/SteamCleaner/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.7.0.0")] -[assembly: AssemblyFileVersion("1.7.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.9.0.0")] +[assembly: AssemblyFileVersion("1.9.0.0")] \ No newline at end of file diff --git a/SteamCleaner/Utilities/CleanerUtilities.cs b/SteamCleaner/Utilities/CleanerUtilities.cs index c4c9e30..4647041 100644 --- a/SteamCleaner/Utilities/CleanerUtilities.cs +++ b/SteamCleaner/Utilities/CleanerUtilities.cs @@ -64,7 +64,7 @@ public static List FindRedistributables() return cachedRedistributables; } var steamPaths = Steam.SteamPaths(); - var crawlableDirs = steamPaths.Select(Steam.FixPath).Where(Directory.Exists).ToList(); + var crawlableDirs = steamPaths.Select(steamPath => Steam.FixPath(steamPath)).Where(path => Directory.Exists(path)).ToList(); var gameDirs = crawlableDirs.Select(Directory.GetDirectories).SelectMany(directories => directories).ToList(); if (Gog.Exisit()) diff --git a/version.xml b/version.xml index 9f008b8..297c0d8 100644 --- a/version.xml +++ b/version.xml @@ -1,5 +1,5 @@ - 1.8 + 1.9 https://github.com/Codeusa/SteamCleaner/releases/latest