예제 #1
0
        /* To Function Features */
        public async void CheckUpdatesClick()
        {
            //UpdateInfo.Content = "Checking for updates...";
            UpdateInfo = await SparkleInst.CheckForUpdatesQuietly();

            // use _sparkle.CheckForUpdatesQuietly() if you don't want the user to know you are checking for updates!
            // if you use CheckForUpdatesAtUserRequest() and are using a UI, then handling things yourself is rather silly
            // as it will show a UI for things
            if (UpdateInfo != null)
            {
                switch (UpdateInfo.Status)
                {
                case UpdateStatus.UpdateAvailable:
                    //UpdateInfo.Content = "There's an update available!";
                    //DownloadUpdateButton.IsEnabled = true;
                    break;

                case UpdateStatus.UpdateNotAvailable:
                    //UpdateInfo.Content = "There's no update available :(";
                    //DownloadUpdateButton.IsEnabled = false;
                    break;

                case UpdateStatus.UserSkipped:
                    //UpdateInfo.Content = "The user skipped this update!";
                    //DownloadUpdateButton.IsEnabled = false;
                    break;

                case UpdateStatus.CouldNotDetermine:
                    //UpdateInfo.Content = "We couldn't tell if there was an update...";
                    //DownloadUpdateButton.IsEnabled = false;
                    break;
                }
            }
        }
예제 #2
0
 public async void UpdateAutomaticallyClick()
 {
     SparkleInst.UserInteractionMode = UserInteractionMode.DownloadAndInstall;
     // TODO: RunFullUpdateUpdateStatusLabel.Text = "Checking for update...";
     SparkleInst.UpdateDetected   += CBFullUpdateUpdateDetected;
     SparkleInst.DownloadStarted  += CBFullUpdateStartedDownloading;
     SparkleInst.DownloadFinished += CBFullUpdateDownloadFileIsReady;
     SparkleInst.CloseApplication += CBFullUpdateCloseApplication;
     await SparkleInst.CheckForUpdatesQuietly();
 }
예제 #3
0
        /* To Function Features */
        public async void CheckUpdatesClick(SGCheckUpdate sgCheckUpdate                 = null,
                                            SGAvailableUpdate sgAvailableUpdate         = null,
                                            SGDownloadUpdate sgDownloadUpdate           = null,
                                            SGFinishedDownload sgFinishedDownload       = null,
                                            SGMessageNotification sgMessageNotification = null)
        {
            CheckUpdate         = sgCheckUpdate;
            AvailableUpdate     = sgAvailableUpdate;
            DownloadUpdate      = sgDownloadUpdate;
            FinishedDownload    = sgFinishedDownload;
            MessageNotification = sgMessageNotification;

            CLog.Here().Information($"AppUpdaterService - CheckUpdates : [ Checking for updates... ]");
            CheckUpdate?.OpenPopUp();
            UpdateInfo = await SparkleInst.CheckForUpdatesQuietly();

            await Task.Delay(1000);

            await Task.Run(() => {
                CheckUpdate?.ClosePopUp();
                // use _sparkle.CheckForUpdatesQuietly() if you don't want the user to know you are checking for updates!
                // if you use CheckForUpdatesAtUserRequest() and are using a UI, then handling things yourself is rather silly
                // as it will show a UI for things
                if (UpdateInfo != null)
                {
                    switch (UpdateInfo.Status)
                    {
                    case UpdateStatus.UpdateAvailable:
                        CLog.Here().Information($"AppUpdaterService - CheckUpdates : [ There's an update available! ]");
                        AvailableUpdate?.OpenPopUp(SparkleInst, UpdateInfo.Updates);
                        break;

                    case UpdateStatus.UpdateNotAvailable:
                        CLog.Here().Information($"AppUpdaterService - CheckUpdates : [ There's no update available :( ]");
                        MessageNotification?.OpenPopUp("There's no update available :(");
                        break;

                    case UpdateStatus.UserSkipped:
                        CLog.Here().Information($"AppUpdaterService - CheckUpdates : [ The user skipped this update! ]");
                        MessageNotification?.OpenPopUp("The user skipped this update!<br>You have elected to skip this version.");
                        break;

                    case UpdateStatus.CouldNotDetermine:
                        CLog.Here().Information($"AppUpdaterService - CheckUpdates : [ We couldn't tell if there was an update... ]");
                        MessageNotification?.OpenPopUp("We couldn't tell if there was an update...");
                        break;
                    }
                }
            });
        }
예제 #4
0
        public async void UpdateAutomaticallyClick()
        {
            await Task.Run(() => {
                // RunFullUpdateUpdateStatusLabel.Text = "Checking for update...";
                CLog.Here().Information($"AppUpdaterService - UpdateAutomatically : [ Checking for updates... ]");

                SparkleInst.UserInteractionMode = UserInteractionMode.DownloadAndInstall;
                SparkleInst.UpdateDetected     += CBFullUpdateUpdateDetected;
                SparkleInst.DownloadStarted    += CBFullUpdateStartedDownloading;
                SparkleInst.DownloadFinished   += CBFullUpdateDownloadFileIsReady;
                SparkleInst.CloseApplication   += CBFullUpdateCloseApplication;
            });

            await SparkleInst.CheckForUpdatesQuietly();
        }