Exemple #1
0
        /// <summary>
        /// Called when the soft is already up to date
        /// </summary>
        protected virtual void OnAlreadyUpdated(GitHubUpdater gitHubUpdater, GitHubUpdater.ReleaseInfo releaseInfo)
        {
            try {
                Config.Instance.TechnicalLastWebserviceCallOk = true;

                if (AlwaysShowNotifications)
                {
                    UserCommunication.NotifyUnique("Update" + UpdatedSoftName, "Congratulations! You already own the latest <b>" + (!gitHubUpdater.GetPreReleases ? "beta" : "stable") + "</b> version of " + UpdatedSoftName + "." + (!gitHubUpdater.GetPreReleases ? "<br><br><i>If you wish to check for beta versions as well, toggle the corresponding option in the update " + "options".ToHtmlLink("options page") + "</i>" : ""), MessageImg.MsgUpdate, UpdatedSoftName + " updater", "Local version is " + gitHubUpdater.LocalVersion, args => {
                        if (args.Link.Equals("options"))
                        {
                            args.Handled = true;
                            Appli.GoToPage(PageNames.OptionsUpdate);
                        }
                    });
                }

                if (OnUpdateDone != null)
                {
                    OnUpdateDone(this);
                }
            } finally {
                _updating = false;
            }
        }
Exemple #2
0
        /// <summary>
        /// Called before the download starts
        /// </summary>
        protected virtual void MainUpdaterOnStartingUpdate(GitHubUpdater gitHubUpdater, GitHubUpdater.ReleaseInfo releaseInfo, GitHubUpdater.StartingDownloadEvent e)
        {
            Config.Instance.TechnicalLastWebserviceCallOk = true;

            DelayedAction.StartNew(2000, () => {
                if (_updating && !UserCommunication.IsUniqueNotifShown("Update" + UpdatedSoftName))
                {
                    UserCommunication.NotifyUnique("Update" + UpdatedSoftName, "A newer version of " + UpdatedSoftName + " (" + releaseInfo.tag_name + ") has been found online.<br>It is being downloaded, you will be notified when the update is available.", MessageImg.MsgUpdate, UpdatedSoftName + " updater", "New version found", null, 5);
                }
            });
        }