コード例 #1
0
        private void DownloadUpdate(EmpireUpdateXml update)
        {
            EmpireUpdateDownloadForm form   = new EmpireUpdateDownloadForm(update.Uri, update.MD5, this.appInfo.AppIcon);
            DialogResult             result = form.ShowDialog(this.appInfo.Context);

            if (result == DialogResult.OK)
            {
                string currentPath = this.appInfo.AppAssembly.Location;
                string newPath     = Path.GetDirectoryName(currentPath) + "\\" + update.FileName;

                UpdateApplication(form.TempFilePath, currentPath, newPath, update.LaunchArgs);

                Application.Exit();
            }
            else if (result == DialogResult.Abort)
            {
                MessageBox.Show("The update download was cancelled.\nTHisProgram has not been modified.", "Update Download Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("There was an error with the update, Please try again later.", "Update Download Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
ファイル: EmpireUpdater.cs プロジェクト: xzyio/Rotmg-PServer
        private void DownloadUpdate(EmpireUpdateXml update)
        {
            EmpireUpdateDownloadForm form = new EmpireUpdateDownloadForm(update.Uri, update.MD5, this.appInfo.AppIcon);
            DialogResult result = form.ShowDialog(this.appInfo.Context);

            if (result == DialogResult.OK)
            {
                string currentPath = this.appInfo.AppAssembly.Location;
                string newPath = Path.GetDirectoryName(currentPath) + "\\" + update.FileName;

                UpdateApplication(form.TempFilePath, currentPath, newPath, update.LaunchArgs);

                Application.Exit();
            }
            else if (result == DialogResult.Abort)
            {
                MessageBox.Show("The update download was cancelled.\nTHisProgram has not been modified.", "Update Download Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("There was an error with the update, Please try again later.", "Update Download Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }