From 8034b91284df58071eae0a335fd284ac20617146 Mon Sep 17 00:00:00 2001 From: icedream Date: Mon, 12 Jan 2015 22:03:02 +0100 Subject: [PATCH] Fix help screen. --- src/updater/CommandLineOptions.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/updater/CommandLineOptions.cs b/src/updater/CommandLineOptions.cs index ad93df7..1e8f811 100644 --- a/src/updater/CommandLineOptions.cs +++ b/src/updater/CommandLineOptions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Linq; using System.Reflection; using CommandLine; using CommandLine.Text; @@ -27,14 +28,30 @@ namespace CitizenMP.Server.Installer [HelpOption] public string GetUsage() { - var programInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); + var asm = Assembly.GetExecutingAssembly(); + + var productName = + asm.GetCustomAttributes(typeof (AssemblyTitleAttribute), false) + .OfType() + .Single() + .Title; + var productVersion = + asm.GetCustomAttributes(typeof (AssemblyInformationalVersionAttribute), false) + .OfType() + .Single() + .InformationalVersion; + var productCopyright = + asm.GetCustomAttributes(typeof (AssemblyCopyrightAttribute), false) + .OfType() + .Single() + .Copyright; var help = new HelpText { AddDashesToOption = true, AdditionalNewLineAfterOption = true, - Copyright = programInfo.LegalCopyright, - Heading = new HeadingInfo(programInfo.ProductName, programInfo.ProductVersion), + Copyright = productCopyright, + Heading = new HeadingInfo(productName, productVersion), MaximumDisplayWidth = Console.BufferWidth };