diff --git a/SteamController/Helpers/SteamConfiguration.cs b/SteamController/Helpers/SteamConfiguration.cs index 17874f3..c184ee0 100644 --- a/SteamController/Helpers/SteamConfiguration.cs +++ b/SteamController/Helpers/SteamConfiguration.cs @@ -189,6 +189,11 @@ namespace SteamController.Helpers return new HashSet(); } + catch (DirectoryNotFoundException) + { + // Steam was installed, but got removed + return null; + } catch (IOException e) { Log.TraceException("STEAM", "Config", e); @@ -218,6 +223,11 @@ namespace SteamController.Helpers File.Copy(configPath, String.Format("{0}.{1}.bak", configPath, suffix)); return true; } + catch (DirectoryNotFoundException) + { + // Steam was installed, but got removed + return false; + } catch (IOException e) { Log.TraceException("STEAM", "Config", e); @@ -279,6 +289,11 @@ namespace SteamController.Helpers File.WriteAllLines(configPath, lines); return true; } + catch (DirectoryNotFoundException) + { + // Steam was installed, but got removed + return false; + } catch (IOException e) { Log.TraceException("STEAM", "Config", e); @@ -297,6 +312,11 @@ namespace SteamController.Helpers byte[] diskContent = File.ReadAllBytes(configPath); return content.SequenceEqual(diskContent); } + catch (DirectoryNotFoundException) + { + // Steam was installed, but got removed + return null; + } catch (IOException e) { Log.TraceException("STEAM", "Config", e); @@ -315,6 +335,11 @@ namespace SteamController.Helpers File.Copy(configPath + ".orig", configPath, true); return true; } + catch (DirectoryNotFoundException) + { + // Steam was installed, but got removed + return null; + } catch (UnauthorizedAccessException) { return false; @@ -359,6 +384,11 @@ namespace SteamController.Helpers { return false; } + catch (DirectoryNotFoundException) + { + // Steam was installed, but got removed + return false; + } catch (IOException e) { Log.TraceException("STEAM", "Config", e);