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/App.config | 6 +++ ShiftOS.Updater/Program.cs | 32 +++++++++++++++ ShiftOS.Updater/Properties/AssemblyInfo.cs | 36 ++++++++++++++++ ShiftOS.Updater/ShiftOS.Updater.csproj | 66 ++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 ShiftOS.Updater/App.config create mode 100644 ShiftOS.Updater/Program.cs create mode 100644 ShiftOS.Updater/Properties/AssemblyInfo.cs create mode 100644 ShiftOS.Updater/ShiftOS.Updater.csproj (limited to 'ShiftOS.Updater') diff --git a/ShiftOS.Updater/App.config b/ShiftOS.Updater/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/ShiftOS.Updater/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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"); + } + } +} diff --git a/ShiftOS.Updater/Properties/AssemblyInfo.cs b/ShiftOS.Updater/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..74602cb --- /dev/null +++ b/ShiftOS.Updater/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ShiftOS.Updater")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ShiftOS.Updater")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("36bc512f-6fd4-4139-aed7-565fc8d5bcbc")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ShiftOS.Updater/ShiftOS.Updater.csproj b/ShiftOS.Updater/ShiftOS.Updater.csproj new file mode 100644 index 0000000..70d8263 --- /dev/null +++ b/ShiftOS.Updater/ShiftOS.Updater.csproj @@ -0,0 +1,66 @@ + + + + + Debug + AnyCPU + {36BC512F-6FD4-4139-AED7-565FC8D5BCBC} + Exe + Properties + ShiftOS.Updater + ShiftOS.Updater + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {2295d2e2-3a00-4e02-b66f-b961ac329fe6} + ShiftOS.WinForms + + + + + \ No newline at end of file -- cgit v1.2.3