예제 #1
0
        private void downloadUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Burntime.Autoupdate.Updater updater = new Burntime.Autoupdate.Updater(debugMode ? "../" : "");

            if (updater.CheckForUpdates())
            {
                if (updater.ShowDownloadQuestion())
                {
                    // update
                    updater.InitiateUpdate();
                    //requestRestart = true;

                    Close();
                    return;
                }

                lblVersion.Text        = updater.LocalVersion;
                downloadUpdate.Text    = "update to " + updater.VersionAvailable;
                downloadUpdate.Visible = true;
            }
            else
            {
                MessageBox.Show("No new version available.");
                downloadUpdate.Visible = false;
            }
        }
예제 #2
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            Burntime.Autoupdate.Updater updater = new Burntime.Autoupdate.Updater(debugMode ? "../" : "");
            lblVersion.Text = updater.LocalVersion;

            if (!updater.AlwaysCheck)
            {
                downloadUpdate.Text    = "check for new version";
                downloadUpdate.Visible = true;
            }
            else
            {
                downloadUpdate.Visible = false;
            }


            if (updater.AlwaysCheck && updater.CheckForUpdates())
            {
                if (updater.AlwaysAsk)
                {
                    if (updater.ShowDownloadQuestion())
                    {
                        // update
                        updater.InitiateUpdate();
                        //requestRestart = true;

                        Close();
                        return;
                    }
                }

                lblVersion.Text        = updater.LocalVersion;
                downloadUpdate.Text    = "update to " + updater.VersionAvailable;
                downloadUpdate.Visible = true;
            }

            if (!path.IsValid)
            {
                if (DialogResult.OK == MessageBox.Show(txt.Data[21] + "\n" + txt.Data[22], txt.Data[23], MessageBoxButtons.OKCancel, MessageBoxIcon.Information))
                {
                    do
                    {
                        if (DialogResult.OK != path.ShowSelector())
                        {
                            break;
                        }

                        btnSingle.Enabled = path.IsValid;
                        btnMulti.Enabled  = path.IsValid & enableMulti;
                        if (btnSingle.Enabled)
                        {
                            btnSingle.Focus();
                        }

                        if (!path.IsValid)
                        {
                            MessageBox.Show(txt.Data[24], txt.Data[23], MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        else
                        {
                            path.Save();
                        }
                    } while (!path.IsValid);
                }
            }
        }