From 7d14daf1d5fce4d09471a3abe2aca49cf7680816 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Wed, 2 Dec 2020 05:25:19 -0500 Subject: embed version info into assemblies check app versions against lib, lib against driver add an 'about' dialog which displays version details, accessible from menu refactor error handling + add check for negative offset --- writer/Program.cs | 25 ++++++++++++------------- writer/Properties/AssemblyInfo.cs | 10 +++++----- 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'writer') diff --git a/writer/Program.cs b/writer/Program.cs index 2d4128f..ec8706b 100644 --- a/writer/Program.cs +++ b/writer/Program.cs @@ -21,18 +21,21 @@ namespace writer return; } - foreach (var err in errors.x) + Console.Write("Bad settings: \n\n{0}", errors); + } + + static void Main(string[] args) + { + try { - Console.WriteLine(err + (settings.combineMagnitudes ? "" : " (x)")); + VersionHelper.ValidateAndGetDriverVersion(typeof(Program).Assembly.GetName().Version); } - foreach (var err in errors.y) + catch (VersionException e) { - Console.WriteLine(err + " (y)"); + Console.WriteLine(e.Message); + return; } - } - static void Main(string[] args) - { if (args.Length != 1 || args[0].Equals("help")) { Console.WriteLine("USAGE: {0} ", System.AppDomain.CurrentDomain.FriendlyName); @@ -59,15 +62,11 @@ namespace writer } catch (JsonException e) { - Console.WriteLine("Settings invalid:\n{0}", e.Message.ToString()); - } - catch (DriverNotInstalledException) - { - Console.WriteLine("Driver is not installed"); + Console.WriteLine("Settings invalid:\n{0}", e.Message); } catch (Exception e) { - Console.WriteLine("Error: {0}", e.Message.ToString()); + Console.WriteLine("Error: {0}", e); } } } diff --git a/writer/Properties/AssemblyInfo.cs b/writer/Properties/AssemblyInfo.cs index 37e79ad..fc6a1ca 100644 --- a/writer/Properties/AssemblyInfo.cs +++ b/writer/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ 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("writer")] +[assembly: AssemblyTitle("Raw Accel settings writer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("writer")] -[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyProduct("Raw Accel")] +[assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 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")] +[assembly: AssemblyVersion(RawAccelVersion.value)] +[assembly: AssemblyFileVersion(RawAccelVersion.value)] -- cgit v1.2.3