public DownloadUpdateDialog(UpdateInfoEventArgs args)
        {
            InitializeComponent();

            _args = args;

            if (AutoUpdater.Mandatory && AutoUpdater.UpdateMode == Mode.ForcedDownload)
            {
                ControlBox = false;
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Shows standard update dialog.
        /// </summary>
        public static void ShowUpdateForm(UpdateInfoEventArgs args)
        {
            using (var updateForm = new UpdateForm(args))
            {
                updateForm.ShowInTaskbar = false;
                if (UpdateFormSize.HasValue)
                {
                    updateForm.Size = UpdateFormSize.Value;
                }

                if (updateForm.ShowDialog().Equals(DialogResult.OK))
                {
                    Exit();
                }
            }
        }
Ejemplo n.º 4
0
        public UpdateForm(UpdateInfoEventArgs args)
        {
            _args = args;
            InitializeComponent();
            UseLatestIE();
            buttonSkip.Visible        = AutoUpdater.ShowSkipButton;
            buttonRemindLater.Visible = AutoUpdater.ShowRemindLaterButton;
            Text = string.Format("{0} {1} is available!",
                                 AutoUpdater.AppTitle, _args.CurrentVersion);
            labelUpdate.Text = string.Format("A new version of {0} is available!",
                                             AutoUpdater.AppTitle);
            labelDescription.Text =
                string.Format("{0} {1} is now available. You have version {2} installed. Would you like to download it now?",
                              AutoUpdater.AppTitle, _args.CurrentVersion, _args.InstalledVersion);

            if (AutoUpdater.Mandatory && AutoUpdater.UpdateMode == Mode.Forced)
            {
                ControlBox = false;
            }
        }