Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
0.1.0.3
Browse files Browse the repository at this point in the history
- Quick fix to the updater to get it working properly
  • Loading branch information
LogicAndTrick committed Jul 27, 2013
1 parent 9978c62 commit 67e490f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
16 changes: 15 additions & 1 deletion Sledge.Editor.Updater/UpdaterForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand Down Expand Up @@ -83,6 +84,13 @@ private void DoUpdate()
Application.Exit();
});
}
else
{
InstallUpdate(directory, download);
Directory.Delete(updateDirectory, true);
Process.Start(Path.Combine(directory, "Sledge.Editor.exe"));
Application.Exit();
}
return;
}
}
Expand Down Expand Up @@ -169,13 +177,19 @@ private void UpdateProgress(object sender, DownloadProgressChangedEventArgs e)

private void InstallUpdate(string installDir, string file)
{
StatusLabel.Text = "Installing update...";
StatusLabel.BeginInvoke((Action) (() =>
{
StatusLabel.Text = "Installing update...";
}));
// File is already in a folder at this point.
var updateDir = Path.GetDirectoryName(file);
if (updateDir == null) return;

UnZip(file); // Extract in-place
File.Delete(file); // Delete archive
// Delete currently used files
File.Delete(Path.Combine(updateDir, "ICSharpCode.SharpZipLib.dll"));
File.Delete(Path.Combine(updateDir, "Sledge.Editor.Updater.exe"));
InstallDirectory(installDir, updateDir); // Move all files across
}

Expand Down
1 change: 0 additions & 1 deletion Sledge.Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using Sledge.Settings;
using Sledge.Settings.Models;
using Hotkeys = Sledge.Editor.UI.Hotkeys;
using Path = Sledge.DataStructures.MapObjects.Path;

namespace Sledge.Editor
{
Expand Down
4 changes: 2 additions & 2 deletions Sledge.Editor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.2")]
[assembly: AssemblyFileVersion("0.1.0.2")]
[assembly: AssemblyVersion("0.1.0.3")]
[assembly: AssemblyFileVersion("0.1.0.3")]

0 comments on commit 67e490f

Please sign in to comment.