aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Updater/Program.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-07 18:33:36 -0400
committerMichael <[email protected]>2017-04-07 18:33:41 -0400
commita8583c95d082d36f6d0665d0b25c2fc6c4b5e943 (patch)
tree2c8af592ec6bfc9d5421ef71c7453a998eaf89a7 /ShiftOS.Updater/Program.cs
parent0d198594c4c1240c274c27706b07e2d3281975ce (diff)
downloadshiftos_thereturn-a8583c95d082d36f6d0665d0b25c2fc6c4b5e943.tar.gz
shiftos_thereturn-a8583c95d082d36f6d0665d0b25c2fc6c4b5e943.tar.bz2
shiftos_thereturn-a8583c95d082d36f6d0665d0b25c2fc6c4b5e943.zip
Update Manager
Use the "ShiftOS.Updater" as your startup project for this to work correctly.
Diffstat (limited to 'ShiftOS.Updater/Program.cs')
-rw-r--r--ShiftOS.Updater/Program.cs32
1 files changed, 32 insertions, 0 deletions
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");
+ }
+ }
+}