mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2025-12-06 07:12:01 +01:00
Catch Steam exceptions where Steam was installed, but removed
This commit is contained in:
parent
82dcbd7d36
commit
d362eb41f5
|
|
@ -189,6 +189,11 @@ namespace SteamController.Helpers
|
|||
|
||||
return new HashSet<String>();
|
||||
}
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue