From 3ebc6d618ac49749644db406fc726bd0333754ba Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 19 Mar 2016 15:31:54 +0100 Subject: [PATCH] Misc --- ArchiSteamFarm/Program.cs | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 467cfa1bd..9f808c7fd 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -242,34 +242,19 @@ namespace ArchiSteamFarm { Logging.LogGenericInfo("Update process is finished! ASF will now restart itself..."); await Utilities.SleepAsync(5000); - if (!Restart()) { - // Make sure that we won't try updating again in this case - if (AutoUpdatesTimer != null) { - AutoUpdatesTimer.Dispose(); - AutoUpdatesTimer = null; - } - - // Inform user about failure - Logging.LogGenericWarning("ASF could not restart itself, you may need to restart it manually!"); - await Utilities.SleepAsync(5000); - } + Restart(); } internal static void Exit(int exitCode = 0) { Environment.Exit(exitCode); } - internal static bool Restart() { + internal static void Restart() { try { - if (Process.Start(ExecutableFile, string.Join(" ", Environment.GetCommandLineArgs().Skip(1))) != null) { - Exit(); - return true; - } else { - return false; - } + Process.Start(ExecutableFile, string.Join(" ", Environment.GetCommandLineArgs().Skip(1))); + Environment.Exit(0); } catch (Exception e) { Logging.LogGenericException(e); - return false; } }