public static void GetGOGApps() { string GOGFilepath; string GOGRegistry_key = @"SOFTWARE\WOW6432Node\GOG.com\GalaxyClient\paths"; using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(GOGRegistry_key)) { GOGFilepath = key.GetValue("client").ToString() + "\\GalaxyClient.exe"; } Exe gogExe = new Exe(); gogExe.gameName = "GOG Galaxy"; gogExe.filePath = GOGFilepath; Exes.Add(gogExe); string registry_key = @"SOFTWARE\WOW6432Node\GOG.com\Games"; using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key)) { foreach (string subkey_name in key.GetSubKeyNames()) { using (RegistryKey subkey = key.OpenSubKey(subkey_name)) { Exe exe = new Exe(); exe.gameName = subkey.GetValue("GAMENAME").ToString(); exe.filePath = subkey.GetValue("LAUNCHCOMMAND").ToString(); exe.launcher = "GOG Galaxy"; Exes.Add(exe); } } } }
private void ExeScan_Click(object sender, EventArgs e) { Exe.FindExes(); Library.Populate(Exe.GetExes()); listView1.View = View.LargeIcon; ExeIconList.ImageSize = new Size(32, 32); listView1.LargeImageList = ExeIconList; this.comboBox1.Items.Clear(); this.comboBox1.Items.Add("All"); this.comboBox1.Items.AddRange(System.Environment.GetLogicalDrives()); this.comboBox1.SelectedItem = this.comboBox1.FindStringExact("All"); this.comboBox1.Text = "All"; this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); ExeIconList.Images.Clear(); listView1.Items.Clear(); Library.DisplayExes(); this.Controls.Add(listView1); Console.WriteLine(listView1.Items.Count); }
public static void GetSteamApps() { List <string> steamLibraryFilepaths = new List <string>(); List <DirectoryInfo> gameFolderPaths = new List <DirectoryInfo>(); Dictionary <string, string> manifestInfo = new Dictionary <string, string>(); string registry_key = @"SOFTWARE\WOW6432Node\Valve\Steam"; using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key)) { steamFilepath = key.GetValue("InstallPath").ToString(); } manifestInfo = ReadSteamGameManifest(); steamLibraryFilepaths.Add(steamFilepath); string libraryFileManifestPath = steamFilepath + "\\steamapps\\libraryfolders.vdf"; StreamReader file = new StreamReader(@libraryFileManifestPath); string line; while ((line = file.ReadLine()) != null) { if (line.Contains(":\\")) { line = line.Substring(7, line.Length - 7); line = line.TrimEnd('"'); steamLibraryFilepaths.Add(line); } } for (int i = 0; i < steamLibraryFilepaths.Count; i++) { steamLibraryFilepaths[i] = steamLibraryFilepaths[i] + "\\steamapps\\common"; //Console.WriteLine(steamLibraryFilepaths[i]); } foreach (string filepath in steamLibraryFilepaths) { DirectoryInfo directoryInfo = new DirectoryInfo(@filepath); gameFolderPaths.AddRange(directoryInfo.GetDirectories()); } foreach (DirectoryInfo gameFolder in gameFolderPaths) { //Console.WriteLine(gameFolder.Name); if (manifestInfo.ContainsKey(gameFolder.Name)) { Exe newExe = new Exe(); newExe.gameName = gameFolder.Name; newExe.filePath = gameFolder.FullName + "\\" + manifestInfo[gameFolder.Name]; newExe.launcher = "Steam"; Console.WriteLine(newExe.filePath); Exes.Add(newExe); } } }
public static void GetEpicApps() { string epicManifestFilepath; string registry_key = @"SOFTWARE\WOW6432Node\Epic Games\EpicGamesLauncher"; using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key)) { epicManifestFilepath = key.GetValue("AppDataPath").ToString() + "\\Manifests"; FileInfo[] manifests; System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(@epicManifestFilepath); manifests = directoryInfo.GetFiles("*.item", SearchOption.TopDirectoryOnly); foreach (FileInfo manifest in manifests) { StreamReader file = new StreamReader(manifest.FullName); string line; string gameName = "NULL"; string gameFilepath = "NULL"; string exeName = "NULL"; while ((line = file.ReadLine()) != null) { if (line.Contains("DisplayName")) { line = line.Substring(17, line.Length - 17); line = line.TrimEnd(','); line = line.TrimEnd('"'); gameName = line; } else if (line.Contains("InstallLocation")) { line = line.Substring(21, line.Length - 21); line = line.TrimEnd(','); line = line.TrimEnd('"'); gameFilepath = line; } else if (line.Contains("LaunchExecutable")) { line = line.Substring(22, line.Length - 22); line = line.TrimEnd(','); line = line.TrimEnd('"'); exeName = line; } } gameFilepath = gameFilepath + "\\" + exeName; Exe newExe = new Exe(); newExe.gameName = gameName; newExe.filePath = gameFilepath; newExe.launcher = "Epic Games"; Exes.Add(newExe); } } }
public static void GetPopularGames() { //League of Legends string leagueFilepath; string leagueRegistry_key = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Riot Game league_of_legends.live"; using (Microsoft.Win32.RegistryKey key = Registry.CurrentUser.OpenSubKey(leagueRegistry_key)) { leagueFilepath = key.GetValue("InstallLocation").ToString() + "\\LeagueClient.exe"; Exe leagueExe = new Exe(); leagueExe.gameName = "League of Legends"; leagueExe.filePath = leagueFilepath; Exes.Add(leagueExe); } //Valorant string valorantFilepath; string valorantRegistry_key = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Riot Game valorant.live"; using (Microsoft.Win32.RegistryKey key = Registry.CurrentUser.OpenSubKey(valorantRegistry_key)) { valorantFilepath = key.GetValue("InstallLocation").ToString() + "\\VALORANT.exe"; Exe valorantExe = new Exe(); valorantExe.gameName = "Valorant"; valorantExe.filePath = valorantFilepath; Exes.Add(valorantExe); } //Minecraft string minecraftFilepath; string minecraftRegistry_key = @"SOFTWARE\WOW6432Node\Mojang\InstalledProducts\Minecraft Launcher"; using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(minecraftRegistry_key)) { minecraftFilepath = key.GetValue("InstallLocation").ToString() + "\\MinecraftLauncher.exe"; Exe minecraftExe = new Exe(); minecraftExe.gameName = "Minecraft"; minecraftExe.filePath = minecraftFilepath; Exes.Add(minecraftExe); } }
private void LocalFilesToolStripMenuItem_Click(object sender, EventArgs e) { Exe exeInfo = new Exe(); exeSettingsDialog dialog1 = new exeSettingsDialog(); foreach (ListViewItem exe in this.listView1.SelectedItems) { exeInfo = Library.GetExes()[exe.Index]; } exeInfo.fileSize = exeInfo.GetFileSize(); dialog1.gameNameLabel.Text = exeInfo.gameName; dialog1.filePathLabel.Text = "Game File Path:\n" + exeInfo.filePath; dialog1.exeNameLabel.Text = "Exe Name: " + exeInfo.exeName.TrimStart('\\'); dialog1.sizeLabel.Text = "Size on Drive: " + exeInfo.fileSize.ToString(); dialog1.launcherLabel.Text = "Launcher: " + exeInfo.launcher; dialog1.exe = exeInfo; dialog1.ShowDialog(); }
public static void UnassignCategory(Exe exe) { }