diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index e23d2137e..7a95b52d5 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -19,7 +19,7 @@ namespace Flow.Launcher.Infrastructure public static readonly string RootDirectory = Directory.GetParent(ApplicationDirectory).ToString(); public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins); - public const string Issue = "https://github.com/Flow-Launcher/Flow.Launcher/issues/new/choose"; + public const string IssuesUrl = "https://github.com/Flow-Launcher/Flow.Launcher/issues"; public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion; public static readonly string Dev = "Dev"; public const string Documentation = "https://flowlauncher.com/docs/#/usage-tips"; diff --git a/Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs b/Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs index 54c19c048..025109e58 100644 --- a/Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs +++ b/Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; -using System.Xml; using Microsoft.Win32; namespace Flow.Launcher.Infrastructure.Exception @@ -63,7 +62,7 @@ namespace Flow.Launcher.Infrastructure.Exception sb.AppendLine($"* Command Line: {Environment.CommandLine}"); sb.AppendLine($"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}"); sb.AppendLine($"* Flow Launcher version: {Constant.Version}"); - sb.AppendLine($"* OS Version: {Environment.OSVersion.VersionString}"); + sb.AppendLine($"* OS Version: {GetWindowsFullVersionFromRegistry()}"); sb.AppendLine($"* IntPtr Length: {IntPtr.Size}"); sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}"); sb.AppendLine($"* Python Path: {Constant.PythonPath}"); @@ -173,5 +172,35 @@ namespace Flow.Launcher.Infrastructure.Exception } } + + public static string GetWindowsFullVersionFromRegistry() + { + try + { + var buildRevision = GetWindowsRevisionFromRegistry(); + var currentBuild = Environment.OSVersion.Version.Build; + return currentBuild.ToString() + "." + buildRevision; + } + catch + { + return Environment.OSVersion.VersionString; + } + } + + public static string GetWindowsRevisionFromRegistry() + { + try + { + using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\")) + { + var buildRevision = registryKey.GetValue("UBR").ToString(); + return buildRevision; + } + } + catch + { + return "0"; + } + } } } diff --git a/Flow.Launcher/Helper/ErrorReporting.cs b/Flow.Launcher/Helper/ErrorReporting.cs index a7ce7444c..b5da2efad 100644 --- a/Flow.Launcher/Helper/ErrorReporting.cs +++ b/Flow.Launcher/Helper/ErrorReporting.cs @@ -3,8 +3,6 @@ using System.Windows.Threading; using NLog; using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Exception; -using NLog.Fluent; -using Log = Flow.Launcher.Infrastructure.Logger.Log; namespace Flow.Launcher.Helper { @@ -31,11 +29,11 @@ namespace Flow.Launcher.Helper //prevent application exist, so the user can copy prompted error info e.Handled = true; } - + public static string RuntimeInfo() { var info = $"\nFlow Launcher version: {Constant.Version}" + - $"\nOS Version: {Environment.OSVersion.VersionString}" + + $"\nOS Version: {ExceptionFormatter.GetWindowsFullVersionFromRegistry()}" + $"\nIntPtr Length: {IntPtr.Size}" + $"\nx64: {Environment.Is64BitOperatingSystem}"; return info; diff --git a/Flow.Launcher/ReportWindow.xaml.cs b/Flow.Launcher/ReportWindow.xaml.cs index 4899edc14..a2e7a8562 100644 --- a/Flow.Launcher/ReportWindow.xaml.cs +++ b/Flow.Launcher/ReportWindow.xaml.cs @@ -23,7 +23,7 @@ namespace Flow.Launcher SetException(exception); } - private static string GetIssueUrl(string website) + private static string GetIssuesUrl(string website) { if (!website.StartsWith("https://github.com")) { @@ -31,10 +31,10 @@ namespace Flow.Launcher } if(website.Contains("Flow-Launcher/Flow.Launcher")) { - return Constant.Issue; + return Constant.IssuesUrl; } var treeIndex = website.IndexOf("tree", StringComparison.Ordinal); - return treeIndex == -1 ? $"{website}/issues/new" : $"{website[..treeIndex]}/issues/new"; + return treeIndex == -1 ? $"{website}/issues" : $"{website[..treeIndex]}/issues"; } private void SetException(Exception exception) @@ -45,8 +45,8 @@ namespace Flow.Launcher var websiteUrl = exception switch { - FlowPluginException pluginException =>GetIssueUrl(pluginException.Metadata.Website), - _ => Constant.Issue + FlowPluginException pluginException =>GetIssuesUrl(pluginException.Metadata.Website), + _ => Constant.IssuesUrl }; @@ -86,4 +86,4 @@ namespace Flow.Launcher return paragraph; } } -} \ No newline at end of file +} diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs index 37f0a126e..73627592a 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs @@ -53,7 +53,7 @@ namespace Flow.Launcher.Plugin.PluginsManager { // standard UrlSourceCode format in PluginsManifest's plugins.json file: https://github.com/jjw24/Flow.Launcher.Plugin.Putty/tree/master var link = pluginManifestInfo.UrlSourceCode.StartsWith("https://github.com") - ? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues/new/choose" + ? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues" : pluginManifestInfo.UrlSourceCode; Context.API.OpenUrl(link);