mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Print windows build number in log
This commit is contained in:
parent
c61d6f791c
commit
2bba75b27a
2 changed files with 19 additions and 6 deletions
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace Flow.Launcher.Infrastructure.Exception
|
namespace Flow.Launcher.Infrastructure.Exception
|
||||||
|
|
@ -63,7 +62,7 @@ namespace Flow.Launcher.Infrastructure.Exception
|
||||||
sb.AppendLine($"* Command Line: {Environment.CommandLine}");
|
sb.AppendLine($"* Command Line: {Environment.CommandLine}");
|
||||||
sb.AppendLine($"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
sb.AppendLine($"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||||
sb.AppendLine($"* Flow Launcher version: {Constant.Version}");
|
sb.AppendLine($"* Flow Launcher version: {Constant.Version}");
|
||||||
sb.AppendLine($"* OS Version: {Environment.OSVersion.VersionString}");
|
sb.AppendLine($"* OS Version: {GetWindowsBuildVersionFromRegistry()}");
|
||||||
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
|
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
|
||||||
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
|
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
|
||||||
sb.AppendLine($"* Python Path: {Constant.PythonPath}");
|
sb.AppendLine($"* Python Path: {Constant.PythonPath}");
|
||||||
|
|
@ -173,5 +172,21 @@ namespace Flow.Launcher.Infrastructure.Exception
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public static string GetWindowsBuildVersionFromRegistry()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\"))
|
||||||
|
{
|
||||||
|
var buildRevision = registryKey.GetValue("UBR").ToString();
|
||||||
|
var currentBuild = registryKey.GetValue("CurrentBuild").ToString();
|
||||||
|
return currentBuild + "." + buildRevision;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Environment.OSVersion.VersionString;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ using System.Windows.Threading;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Flow.Launcher.Infrastructure;
|
using Flow.Launcher.Infrastructure;
|
||||||
using Flow.Launcher.Infrastructure.Exception;
|
using Flow.Launcher.Infrastructure.Exception;
|
||||||
using NLog.Fluent;
|
|
||||||
using Log = Flow.Launcher.Infrastructure.Logger.Log;
|
|
||||||
|
|
||||||
namespace Flow.Launcher.Helper
|
namespace Flow.Launcher.Helper
|
||||||
{
|
{
|
||||||
|
|
@ -35,7 +33,7 @@ namespace Flow.Launcher.Helper
|
||||||
public static string RuntimeInfo()
|
public static string RuntimeInfo()
|
||||||
{
|
{
|
||||||
var info = $"\nFlow Launcher version: {Constant.Version}" +
|
var info = $"\nFlow Launcher version: {Constant.Version}" +
|
||||||
$"\nOS Version: {Environment.OSVersion.VersionString}" +
|
$"\nOS Version: {ExceptionFormatter.GetWindowsBuildVersionFromRegistry()}" +
|
||||||
$"\nIntPtr Length: {IntPtr.Size}" +
|
$"\nIntPtr Length: {IntPtr.Size}" +
|
||||||
$"\nx64: {Environment.Is64BitOperatingSystem}";
|
$"\nx64: {Environment.Is64BitOperatingSystem}";
|
||||||
return info;
|
return info;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue