Exemplo n.º 1
0
        private void beginUpdateCheck()
        {
            string strLocalUpdateXML = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "upgrade.xml");

            string strLocalUpdateXML = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "upgrade_x64.xml");

            UpdateWindow update = new UpdateWindow(this, this.Settings);
            update.GetUpdateData(true);
            if (update.HasUpdatableFiles()) // If there are updated files, display the window
            {
                if (File.Exists(strLocalUpdateXML))
                {
                    update.Visible = true;
                    update.StartAutoUpdate();
                    while (update.Visible == true)
                    {
                        Application.DoEvents();
                        System.Threading.Thread.Sleep(1000);
                    }
                }
                else
                {
                    if (MessageBox.Show("There are updated files available. Do you wish to update to the latest versions?",
                        "Updates Available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        update.ShowDialog();
                }
            }
            else
            {
                if (File.Exists(strLocalUpdateXML))
                    File.Delete(strLocalUpdateXML);
            }
        }
Exemplo n.º 2
0
 private void mnuUpdate_Click(object sender, EventArgs e)
 {
     UpdateWindow update = new UpdateWindow(this, this.Settings);
     update.ShowDialog();
 }