diff --git a/Greenshot/Forms/AboutForm.cs b/Greenshot/Forms/AboutForm.cs index 4d9f1c193..4d3b83021 100644 --- a/Greenshot/Forms/AboutForm.cs +++ b/Greenshot/Forms/AboutForm.cs @@ -21,7 +21,6 @@ using System; using System.Diagnostics; -using System.Reflection; using System.Windows.Forms; using System.IO; using System.Drawing; @@ -149,32 +148,8 @@ namespace Greenshot { // Use the self drawn image, first we create the background to be the backcolor (as we animate from this) _bitmap = ImageHelper.CreateEmpty(90, 90, PixelFormat.Format24bppRgb, BackColor, 96, 96); pictureBox1.Image = _bitmap; - var executingAssembly = Assembly.GetExecutingAssembly(); - // Use assembly version - string greenshotVersion = executingAssembly.GetName().Version.ToString(); - - // Use AssemblyFileVersion if available - var v = executingAssembly.GetName().Version; - var assemblyFileVersion = executingAssembly.GetCustomAttribute(); - if (!string.IsNullOrEmpty(assemblyFileVersion?.Version)) - { - greenshotVersion = assemblyFileVersion.Version; - } - - // Use AssemblyInformationalVersion if available - var assemblyInformationalVersion = executingAssembly.GetCustomAttribute(); - if (!string.IsNullOrEmpty(assemblyInformationalVersion?.InformationalVersion)) - { - greenshotVersion = assemblyInformationalVersion.InformationalVersion; - } - - greenshotVersion = greenshotVersion.Replace("+", " - "); - - // Format is like this: AssemblyVersion("Major.Minor.Build.Revision")] - lblTitle.Text = "Greenshot " + greenshotVersion + (IniConfig.IsPortable ? " Portable" : "") + (" (" + OsInfo.Bits) + " bit)"; - - //Random rand = new Random(); + lblTitle.Text = "Greenshot " + EnvironmentInfo.GreenshotVersion + (IniConfig.IsPortable ? " Portable" : "") + (" (" + OsInfo.Bits) + " bit)"; // Number of frames the pixel animation takes int frames = FramesForMillis(2000); @@ -190,7 +165,7 @@ namespace Greenshot { // Create the animation, first we do nothing (on the final destination) RectangleAnimator pixelAnimation; - // Make the pixel grom from the middle, if this offset isn't used it looks like it's shifted + // Make the pixel grow from the middle, if this offset isn't used it looks like it's shifted int offset = (w - 2) / 2; // If the optimize for Terminal Server is set we make the animation without much ado @@ -295,7 +270,7 @@ namespace Greenshot { using SolidBrush brush = new SolidBrush(_pixelColor); int index = 0; - // We asume there is nothing to animate in the next Animate loop + // We assume there is nothing to animate in the next Animate loop _hasAnimationsLeft = false; // Pixels of the G foreach (RectangleAnimator pixel in _pixels) { diff --git a/Greenshot/Greenshot.csproj b/Greenshot/Greenshot.csproj index dd4149892..a321ad9b9 100644 --- a/Greenshot/Greenshot.csproj +++ b/Greenshot/Greenshot.csproj @@ -78,7 +78,7 @@ - copy "$(SolutionDir)Greenshot\log4net-debug.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\net471\log4net.xml" + copy "$(SolutionDir)Greenshot\log4net-debug.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\net472\log4net.xml" diff --git a/Greenshot/Helpers/EnvironmentInfo.cs b/Greenshot/Helpers/EnvironmentInfo.cs index f467b423d..e1a1c236e 100644 --- a/Greenshot/Helpers/EnvironmentInfo.cs +++ b/Greenshot/Helpers/EnvironmentInfo.cs @@ -23,9 +23,10 @@ using System; using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Windows.Forms; +using GreenshotPlugin.Core; using GreenshotPlugin.IniFile; using GreenshotPlugin.UnmanagedHelpers; +using Microsoft.Win32; namespace Greenshot.Helpers { @@ -55,10 +56,38 @@ namespace Greenshot.Helpers return Type.GetType("System.Reflection.ReflectionContext", false) != null; } + public static string GreenshotVersion + { + get + { + var executingAssembly = Assembly.GetExecutingAssembly(); + + // Use assembly version + string greenshotVersion = executingAssembly.GetName().Version.ToString(); + + // Use AssemblyFileVersion if available + var v = executingAssembly.GetName().Version; + var assemblyFileVersion = executingAssembly.GetCustomAttribute(); + if (!string.IsNullOrEmpty(assemblyFileVersion?.Version)) + { + greenshotVersion = assemblyFileVersion.Version; + } + + // Use AssemblyInformationalVersion if available + var assemblyInformationalVersion = executingAssembly.GetCustomAttribute(); + if (!string.IsNullOrEmpty(assemblyInformationalVersion?.InformationalVersion)) + { + greenshotVersion = assemblyInformationalVersion.InformationalVersion; + } + + return greenshotVersion.Replace("+", " - "); + } + } + public static string EnvironmentToString(bool newline) { StringBuilder environment = new StringBuilder(); - environment.Append("Software version: " + Application.ProductVersion); + environment.Append("Software version: " + GreenshotVersion); if (IniConfig.IsPortable) { environment.Append(" Portable"); } @@ -225,16 +254,11 @@ namespace Greenshot.Helpers /// /// Determines if the current application is 32 or 64-bit. /// - public static int Bits - { - get - { - return IntPtr.Size * 8; - } - } + public static int Bits => IntPtr.Size * 8; private static string _sEdition; - /// + + /// /// Gets the edition of the operating system running on this computer. /// public static string Edition @@ -578,7 +602,8 @@ namespace Greenshot.Helpers } break; case 10: - name = "Windows 10"; + string releaseId = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", "").ToString(); + name = $"Windows 10 {releaseId}"; break; } break; @@ -771,6 +796,10 @@ namespace Greenshot.Helpers { get { + if (WindowsVersion.IsWindows10OrLater) + { + return $"build {Environment.OSVersion.Version.Build}"; + } if (Environment.OSVersion.Version.Revision != 0) { return $"{Environment.OSVersion.Version.Major}.{Environment.OSVersion.Version.Minor} build {Environment.OSVersion.Version.Build} revision {Environment.OSVersion.Version.Revision:X}"; diff --git a/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-zh-CN.xml b/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-zh-CN.xml index a5e48c945..669f756ef 100644 --- a/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-zh-CN.xml +++ b/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-zh-CN.xml @@ -1,5 +1,5 @@  - + 配置外部命令 参数