/// <summary> /// Starts ASB /// </summary> private void Launch(bool updateResult) { if (updateResult) { UpdateProgressBar("ASB up to date!"); } else { UpdateProgressBar(updater.LastError()); } Task.Delay(launchDelay).ContinueWith(_ => { Process.Start(Path.Combine(applicationPath, APPLICATIONEXE_NAME), "cleanupUpdater"); updater.Cleanup(); Exit(); }); }
/// <summary> /// Checks if an update is available /// </summary> /// /// <returns>true if update available</returns> private bool CheckForUpdates() { if (!updater.Fetch()) { UpdateProgressBar("Fetch failed, retrying..."); if (!updater.Fetch()) { return(updater.Cleanup()); } } else if (!updater.Parse()) { UpdateProgressBar(updater.LastError()); return(updater.Cleanup()); } return(true); }