private void btnUpdateCheck_Click(object sender, EventArgs e)
        {
            ManifestUpdate manifest = new ManifestUpdate();

            try
            {
                manifest = ManifestUpdate.GetManifest();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error getting manifest: " + ex.ToString());
                return;
            }

            if (manifest.RemoteVersionNewer)
            {
                frmUpdate frmUpdate = new frmUpdate(manifest);
                if (frmUpdate.ShowDialog() == DialogResult.OK)
                {
                    //move update exe to root folder for execution
                    var updaterExecutionResources    = Application.StartupPath + "\\resources\\OpenBots.Updater.exe";
                    var updaterExecutableDestination = Application.StartupPath + "\\OpenBots.Updater.exe";

                    if (!File.Exists(updaterExecutionResources))
                    {
                        MessageBox.Show("OpenBots.Updater.exe not found in resources directory!");
                        return;
                    }
                    else
                    {
                        File.Copy(updaterExecutionResources, updaterExecutableDestination);
                    }

                    var updateProcess = new Process();
                    updateProcess.StartInfo.FileName  = updaterExecutableDestination;
                    updateProcess.StartInfo.Arguments = manifest.PackageURL;
                    updateProcess.Start();
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show("The application is currently up-to-date!", "No Updates Available", MessageBoxButtons.OK);
            }
        }
Beispiel #2
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            string s = dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[0].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[1].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[2].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[3].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[4].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[5].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[6].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[7].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[8].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[9].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[10].Value.ToString() + "_"
                       + dgvNhanSu.Rows[dgvNhanSu.CurrentRow.Index].Cells[11].Value.ToString();

            update = new frmUpdate(s);
            update.ShowDialog();

            dgvNhanSu.DataSource = da.Query("[DSNHANVIEN]");
        }
Beispiel #3
0
        private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmUpdate UpdateForm = new frmUpdate();

            UpdateForm.ShowDialog();
        }