From a8583c95d082d36f6d0665d0b25c2fc6c4b5e943 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Apr 2017 18:33:36 -0400 Subject: Update Manager Use the "ShiftOS.Updater" as your startup project for this to work correctly. --- ShiftOS.Updater/Program.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ShiftOS.Updater/Program.cs (limited to 'ShiftOS.Updater/Program.cs') diff --git a/ShiftOS.Updater/Program.cs b/ShiftOS.Updater/Program.cs new file mode 100644 index 0000000..df41492 --- /dev/null +++ b/ShiftOS.Updater/Program.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace ShiftOS.Updater +{ + class Program + { + static void Main(string[] args) + { + if (Directory.Exists("updater-work")) + { + //Give the engine time to shutdown before invoking this app. + Thread.Sleep(5000); + foreach (var f in Directory.GetFiles("updater-work")) + { + var bytes = File.ReadAllBytes(f); + var finf = new FileInfo(f); + File.WriteAllBytes(finf.Name, bytes); + } + Directory.Delete("updater-work", true); + } + + //Restart the actual game. + System.Diagnostics.Process.Start("ShiftOS.WinForms.exe"); + } + } +} -- cgit v1.2.3