From d90ea0ba0126f0a4bee6fd200e1fb5219ad884dc Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 11 Feb 2017 12:43:57 -0500 Subject: [PATCH] commit really safe for work crash handler now shows assemblyname and assemblydescription --- ShiftOS.WinForms/Program.cs | 1 + ShiftOS_TheReturn/CrashHandler.cs | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs index 33d7b2f..0578389 100644 --- a/ShiftOS.WinForms/Program.cs +++ b/ShiftOS.WinForms/Program.cs @@ -48,6 +48,7 @@ namespace ShiftOS.WinForms Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //if ANYONE puts code before those two winforms config lines they will be declared a drunky. - Michael + CrashHandler.SetGameMetadata(Assembly.GetExecutingAssembly()); SkinEngine.SetIconProber(new ShiftOSIconProvider()); ShiftOS.Engine.AudioManager.Init(new ShiftOSAudioProvider()); Localization.RegisterProvider(new WFLanguageProvider()); diff --git a/ShiftOS_TheReturn/CrashHandler.cs b/ShiftOS_TheReturn/CrashHandler.cs index a723136..734f1a9 100644 --- a/ShiftOS_TheReturn/CrashHandler.cs +++ b/ShiftOS_TheReturn/CrashHandler.cs @@ -109,7 +109,10 @@ namespace ShiftOS.Engine System.IO.FileInfo fileInfo = new System.IO.FileInfo(assembly.Location); DateTime lastModified = fileInfo.LastWriteTime; - string rtbcrash_Text = $@" === ShiftOS has crashed === + string rtbcrash_Text = $@" === {AssemblyName} has crashed. === + +Game: {AssemblyName} +Description: {AssemblyDescription} Basic Information For User: --------------------------------- @@ -195,5 +198,21 @@ Stack trace: this.Close(); Application.Restart(); } + + public static string AssemblyName { get; private set; } + public static string AssemblyDescription { get; private set; } + + public static void SetGameMetadata(Assembly assembly) + { + AssemblyName = assembly.GetName().Name; + foreach(var attr in assembly.GetCustomAttributes(true)) + { + if(attr is AssemblyDescriptionAttribute) + { + AssemblyDescription = (attr as AssemblyDescriptionAttribute).Description; + } + } + + } } }