private List <string> GetBlizzardGameDetails() { List <string> gamesPathnames = new List <string>(); foreach (var gameName in new[] { "Overwatch", "Heroes of the Storm", "Hearthstone", "World of Warcraft", "Diablo 3", "Starcraft 2", "Destiny 2" }) { try { string pathname = RegistryManager.FindInstallLocationByName(gameName); gamesPathnames.Add(pathname); string[] directoryPathSplitted = pathname.Split('\\'); InstalledGames[gameName] = new PathnameSizePair { PathName = directoryPathSplitted[directoryPathSplitted.Length - 1], Size = Utilities.DirSize(new DirectoryInfo(pathname)).ToString() }; } catch (NoKeyFoundException) { } } return(gamesPathnames); }
private void GetSteamGameDetails(string[] lines) { string futureKey = null; string pathname = ""; foreach (var line in lines) { if (line.Contains("\"name\"")) { futureKey = GetValuesFromLine(line)[1]; } else if (line.Contains("\"installdir\"")) { pathname = GetValuesFromLine(line)[1]; } else if (line.Contains("\"SizeOnDisk\"")) { if (futureKey != null) { InstalledGames[futureKey] = new PathnameSizePair { PathName = pathname, Size = GetValuesFromLine(line)[1] } } ; break; } } }