Ejemplo n.º 1
0
        /// <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();
            });
        }
Ejemplo n.º 2
0
        /// <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);
        }