mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 20:32:34 +00:00
2c0f530ba5
Changed the way editor is closed during the update process (updater now asks to close the editor after downloading the update package). Added write access check before performing the update. The editor can now update the updater. Updater: merged relevant parts of SharpCompress into the updater source, reducing updater file size from 900 kb to 150 kb. Updated ZDoom_DECORATE.cfg.
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CodeImp.DoomBuilder.Windows
|
|
{
|
|
public partial class UpdateForm : DelayedForm
|
|
{
|
|
public bool IgnoreThisUpdate { get { return ignorethisupdate.Checked; } }
|
|
private int remoterev;
|
|
|
|
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;
|
|
this.remoterev = remoterev;
|
|
}
|
|
|
|
private void UpdateForm_Shown(object sender, EventArgs e)
|
|
{
|
|
this.changelog.Focus();
|
|
}
|
|
|
|
private void downloadupdate_Click(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
// Working directory must be set
|
|
Process.Start(new ProcessStartInfo { WorkingDirectory = General.AppPath, FileName = "Updater.exe", Arguments = "-rev " + remoterev });
|
|
|
|
this.Close();
|
|
}
|
|
|
|
private void cancel_Click(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.Cancel;
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|