2015-07-01 23:09:34 +00:00
|
|
|
|
using System;
|
2016-10-08 21:09:55 +00:00
|
|
|
|
using System.Diagnostics;
|
2015-07-01 23:09:34 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Windows
|
|
|
|
|
{
|
2016-09-10 11:24:03 +00:00
|
|
|
|
public partial class UpdateForm : DelayedForm
|
2015-07-01 23:09:34 +00:00
|
|
|
|
{
|
2015-09-04 12:44:09 +00:00
|
|
|
|
public bool IgnoreThisUpdate { get { return ignorethisupdate.Checked; } }
|
2016-10-08 21:09:55 +00:00
|
|
|
|
private int remoterev;
|
2015-09-04 12:44:09 +00:00
|
|
|
|
|
2015-07-01 23:09:34 +00:00
|
|
|
|
public UpdateForm(int remoterev, string changelog)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
Setup(remoterev, changelog);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Setup(int remoterev, string changelog)
|
|
|
|
|
{
|
|
|
|
|
this.Text = this.Text.Replace("[rev]", remoterev.ToString());
|
|
|
|
|
this.label.Text = label.Text.Replace("[rev]", remoterev.ToString());
|
|
|
|
|
this.changelog.SelectedRtf = changelog;
|
2016-10-08 21:09:55 +00:00
|
|
|
|
this.remoterev = remoterev;
|
2015-07-26 23:18:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UpdateForm_Shown(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-07-01 23:09:34 +00:00
|
|
|
|
this.changelog.Focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void downloadupdate_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
2016-10-08 21:09:55 +00:00
|
|
|
|
|
|
|
|
|
// Working directory must be set
|
|
|
|
|
Process.Start(new ProcessStartInfo { WorkingDirectory = General.AppPath, FileName = "Updater.exe", Arguments = "-rev " + remoterev });
|
|
|
|
|
|
2015-07-01 23:09:34 +00:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|