private bool RestartAppIfNecessaryImpl(uint appid) { // Write the Steam AppID to a local file if not dropped by the other method. SteamAppId.WriteToDirectory(_applicationFolder, (int)appid); _restartAppIfNecessaryHook.OriginalFunction(appid); return(false); }
private void DropSteamAppId(Logger logger) { try { var manager = new SteamAppsManager(); foreach (var app in manager.SteamApps) { if (!_applicationFolder.Contains(app.InstallDir)) { continue; } logger.SteamWriteLineAsync($"Found Steam Library Entry with Id {app.AppID}. Dropping {SteamAppId.FileName}.", logger.ColorSuccess); SteamAppId.WriteToDirectory(_applicationFolder, app.AppID); return; } logger.SteamWriteLineAsync($"Application not found in any Steam library. Recommend dropping a {SteamAppId.FileName} yourself.", logger.ColorError); } catch (Exception e) { logger.SteamWriteLineAsync($"Failed to scan through Steam games and locate current game. Error: {e.Message}, {e.StackTrace}", logger.ColorError); } }