Example #1
0
        public UpdateDialog(UpdateInfoEventArgs args)
        {
            _args = args;

            InitializeComponent();

            UseLatestIE();

            kbtnSkip.Visible = AutoUpdater.ShowSkipButton;

            kbtnRemindLater.Visible = AutoUpdater.ShowRemindLaterButton;
            var resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateDialog));

            Text = string.Format(resources.GetString("$this.Text", CultureInfo.CurrentCulture),
                                 AutoUpdater.AppTitle, _args.CurrentVersion);
            labelUpdate.Text = string.Format(resources.GetString("labelUpdate.Text", CultureInfo.CurrentCulture),
                                             AutoUpdater.AppTitle);
            labelDescription.Text =
                string.Format(resources.GetString("labelDescription.Text", CultureInfo.CurrentCulture),
                              AutoUpdater.AppTitle, _args.CurrentVersion, _args.InstalledVersion);

            if (AutoUpdater.Mandatory && AutoUpdater.UpdateMode == Mode.FORCED)
            {
                ControlBox = false;
            }
        }
        public DownloadUpdateDialog(UpdateInfoEventArgs args)
        {
            InitializeComponent();

            _args = args;

            if (AutoUpdater.Mandatory && AutoUpdater.UpdateMode == Mode.FORCEDDOWNLOAD)
            {
                ControlBox = false;
            }
        }
Example #3
0
        /// <summary>
        /// Shows standard update dialog.
        /// </summary>
        public static void ShowUpdateForm(UpdateInfoEventArgs args)
        {
            using (var updateForm = new UpdateDialog(args))
            {
                if (UpdateFormSize.HasValue)
                {
                    updateForm.Size = UpdateFormSize.Value;
                }

                if (updateForm.ShowDialog().Equals(DialogResult.OK))
                {
                    Exit();
                }
            }
        }
Example #4
0
        /// <summary>
        ///     Opens the Download window that download the update and execute the installer when download completes.
        /// </summary>
        public static bool DownloadUpdate(UpdateInfoEventArgs args)
        {
            using (var downloadDialog = new DownloadUpdateDialog(args))
            {
                try
                {
                    return(downloadDialog.ShowDialog().Equals(DialogResult.OK));
                }
                catch (TargetInvocationException)
                {
                }
            }

            return(false);
        }