KeyValues TryGetConfigByAppId(int appId) { KeyValues apps = null; try { apps = KeyValues.GetKeyValue(new[] { "InstallConfigStore", "Software", "Valve", "Steam", "apps" }); } catch (KeyNotFoundException ex) { MainLog.Logger.FormattedWarnException(ex, "Config Store Invalid"); return(null); } try { return(apps.GetKeyValue(appId.ToString())); } catch (Exception) { return(null); } }
// ReSharper disable once ReturnTypeCanBeEnumerable.Local IReadOnlyList <IAbsoluteDirectoryPath> GetBaseInstallFolderPaths() { var list = new List <IAbsoluteDirectoryPath>(); list.Add(_steamPath); if (KeyValues == null) { return(list.AsReadOnly()); } try { var kv = KeyValues.GetKeyValue(new[] { "InstallConfigStore", "Software", "Valve", "Steam" }); var iFolder = 1; while (kv.ContainsKey("BaseInstallFolder_" + iFolder)) { list.Add(kv.GetString("BaseInstallFolder_" + iFolder).ToAbsoluteDirectoryPath()); iFolder++; } } catch (KeyNotFoundException ex) { MainLog.Logger.FormattedWarnException(ex, "Config Store Invalid"); } return(list.AsReadOnly()); }