public static void Launch() { if (OperatingSystem.IsWindows()) { /* * using (RegistryKey key = Registry.LocalMachine.OpenSubKey(GOG_REG_CLIENT, RegistryKeyPermissionCheck.ReadSubTree)) // HKLM32 * { * string launcherPath = Path.Combine(GetRegStrVal(key, "client"), LAUNCH); * if (File.Exists(launcherPath)) * Process.Start(launcherPath); * else * { * //SetFgColour(cols.errorCC, cols.errorLtCC); * CLogger.LogWarn("Cannot start {0} launcher.", _name.ToUpper()); * Console.WriteLine("ERROR: Launcher couldn't start. Is it installed properly?"); * //Console.ResetColor(); * } * } */ CDock.StartShellExecute(PROTOCOL); } else { Process.Start(PROTOCOL); } }
public static void Launch() { if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(PROTOCOL); } else { Process.Start(PROTOCOL); } }
public static void InstallGame(CGame game) { if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(START_GAME + "/" + GetGameID(game.ID)); } else { Process.Start(START_GAME + "/" + GetGameID(game.ID)); } }
public static void InstallGame(CGame game) { CDock.DeleteCustomImage(game.Title); if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(INSTALL_GAME + "/" + GetGameID(game.ID)); } else { Process.Start(INSTALL_GAME + "/" + GetGameID(game.ID)); } }
// return value // -1 = not implemented // 0 = failure // 1 = success public static int InstallGame(CGame game) { CDock.DeleteCustomImage(game.Title); if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(START_GAME + game.ID); } else { Process.Start(START_GAME + game.ID); } return(1); }
// return value // -1 = not implemented // 0 = failure // 1 = success public static int InstallGame(CGame game) { //CDock.DeleteCustomImage(game.Title); //bool useEGL = (bool)CConfig.GetConfigBool(CConfig.CFG_USEEGL); bool useLeg = (bool)CConfig.GetConfigBool(CConfig.CFG_USELEG); string pathLeg = CConfig.GetConfigString(CConfig.CFG_PATHLEG); if (string.IsNullOrEmpty(pathLeg)) { useLeg = false; } if (!pathLeg.Contains(@"\") && !pathLeg.Contains("/")) // legendary.exe in current directory { pathLeg = Path.Combine(Directory.GetCurrentDirectory(), pathLeg); } if (useLeg && File.Exists(pathLeg)) { if (OperatingSystem.IsWindows()) { CLogger.LogInfo($"Launch: cmd.exe /c \"" + pathLeg + "\" -y install " + game.ID); CDock.StartAndRedirect("cmd.exe", "/c '\"" + pathLeg + "\" -y install " + game.ID); } else { CLogger.LogInfo($"Launch: " + pathLeg + " -y install " + game.ID); Process.Start(pathLeg, "-y install " + game.ID); } return(1); } else //if (useEGL) { if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(START_GAME + game.ID + INSTALL_GAME_ARGS); } else { Process.Start(START_GAME + game.ID + INSTALL_GAME_ARGS); } return(1); } //return 0; }
// return value // -1 = not implemented // 0 = failure // 1 = success public static int InstallGame(CGame game) { /* * // Some games don't provide a valid ID * if (game.ID.StartsWith(PlatformUplay.UPLAY_PREFIX)) * { */ //CDock.DeleteCustomImage(game.Title); if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(START_GAME + GetGameID(game.ID)); } else { Process.Start(START_GAME + GetGameID(game.ID)); } return(1); /* * } * else return 0; */ }
public static void StartGame(CGame game) { bool useEGL = (bool)CConfig.GetConfigBool(CConfig.CFG_USEEGL); bool useLeg = (bool)CConfig.GetConfigBool(CConfig.CFG_USELEG); bool syncLeg = (bool)CConfig.GetConfigBool(CConfig.CFG_SYNCLEG); string pathLeg = CConfig.GetConfigString(CConfig.CFG_PATHLEG); if (string.IsNullOrEmpty(pathLeg)) { useLeg = false; } if (!pathLeg.Contains(@"\") && !pathLeg.Contains("/")) // legendary.exe in current directory { pathLeg = Path.Combine(Directory.GetCurrentDirectory(), pathLeg); } if (useLeg && File.Exists(pathLeg)) { if (OperatingSystem.IsWindows()) { string cmdLine = "\"" + pathLeg + "\" -y launch " + game.ID; CLogger.LogInfo($"Launch: cmd.exe /c " + cmdLine); if (syncLeg) { cmdLine = "\"" + pathLeg + "\" -y sync-saves " + game.ID + " & " + cmdLine + " & \"" + pathLeg + "\" -y sync-saves " + game.ID; } CDock.StartAndRedirect("cmd.exe", "/c '" + cmdLine + " '"); } else { CLogger.LogInfo($"Launch: " + pathLeg + " -y launch " + game.ID); if (syncLeg) { Process.Start(pathLeg, "-y sync-saves " + game.ID); } Process.Start(pathLeg, "-y launch " + game.ID); if (syncLeg) { Process.Start(pathLeg, "-y sync-saves " + game.ID); } } } else if (useEGL) { if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(START_GAME + game.ID + START_GAME_ARGS); } else { Process.Start(PROTOCOL + START_GAME + game.ID + START_GAME_ARGS); } } else { if (OperatingSystem.IsWindows()) { CDock.StartShellExecute(game.Launch); } else { Process.Start(game.Launch); } } }