summaryrefslogtreecommitdiff
path: root/writer
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-12-02 05:25:19 -0500
committera1xd <[email protected]>2020-12-02 05:25:19 -0500
commit7d14daf1d5fce4d09471a3abe2aca49cf7680816 (patch)
tree43411443aadc79d36ad1da8063208cd51fdb15fe /writer
parentmerge common-install with common (diff)
downloadrawaccel-7d14daf1d5fce4d09471a3abe2aca49cf7680816.tar.xz
rawaccel-7d14daf1d5fce4d09471a3abe2aca49cf7680816.zip
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
Diffstat (limited to 'writer')
-rw-r--r--writer/Program.cs25
-rw-r--r--writer/Properties/AssemblyInfo.cs10
2 files changed, 17 insertions, 18 deletions
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} <file>", 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)]