diff --git a/trunk/ProcessHacker.Native/OSVersion.cs b/trunk/ProcessHacker.Native/OSVersion.cs index 9124044a6..4372ef25a 100644 --- a/trunk/ProcessHacker.Native/OSVersion.cs +++ b/trunk/ProcessHacker.Native/OSVersion.cs @@ -69,6 +69,7 @@ namespace ProcessHacker.Native private static int _bits = IntPtr.Size * 8; private static OSArch _arch = IntPtr.Size == 4 ? OSArch.I386 : OSArch.Amd64; private static WindowsVersion _windowsVersion; + private static string _versionString; private static ProcessAccess _minProcessQueryInfoAccess = ProcessAccess.QueryInformation; private static ThreadAccess _minThreadQueryInfoAccess = ThreadAccess.QueryInformation; @@ -146,6 +147,11 @@ namespace ProcessHacker.Native get { return _bits.ToString() + "-" + "bit"; } } + public static string VersionString + { + get { return !string.IsNullOrEmpty(_versionString) ? _versionString : _versionString = Environment.OSVersion.VersionString; } + } + public static OSArch Architecture { get { return _arch; } diff --git a/trunk/ProcessHacker/Components/TaskDialog/TaskDialog.cs b/trunk/ProcessHacker/Components/TaskDialog/TaskDialog.cs index 5feadabee..2bffca432 100644 --- a/trunk/ProcessHacker/Components/TaskDialog/TaskDialog.cs +++ b/trunk/ProcessHacker/Components/TaskDialog/TaskDialog.cs @@ -463,32 +463,6 @@ namespace ProcessHacker.Components this.Reset(); } - /// - /// Returns true if the current operating system supports TaskDialog. If false TaskDialog.Show should not - /// be called as the results are undefined but often results in a crash. - /// - public static bool IsAvailableOnThisOS - { - get - { - OperatingSystem os = Environment.OSVersion; - if (os.Platform != PlatformID.Win32NT) - { - return false; - } - - return (os.Version.CompareTo(TaskDialog.RequiredOSVersion) >= 0); - } - } - - /// - /// The minimum Windows version needed to support TaskDialog. - /// - public static Version RequiredOSVersion - { - get { return new Version(6, 0, 5243); } - } - /// /// The string to be used for the dialog box title. If this parameter is NULL, the filename of the executable program is used. /// diff --git a/trunk/ProcessHacker/Program/Program.cs b/trunk/ProcessHacker/Program/Program.cs index 760a6b1c4..21956c8c6 100644 --- a/trunk/ProcessHacker/Program/Program.cs +++ b/trunk/ProcessHacker/Program/Program.cs @@ -890,7 +890,7 @@ namespace ProcessHacker info.AppendLine("Process Hacker " + Application.ProductVersion); info.AppendLine("Process Hacker Build Time: " + Utils.GetAssemblyBuildDate(System.Reflection.Assembly.GetExecutingAssembly(), false).ToString(System.Globalization.DateTimeFormatInfo.InvariantInfo)); info.AppendLine("CLR Version: " + Environment.Version.ToString()); - info.AppendLine("OS Version: " + Environment.OSVersion.VersionString + " (" + OSVersion.BitsString + ")"); + info.AppendLine("OS Version: " + OSVersion.VersionString + " (" + OSVersion.BitsString + ")"); info.AppendLine("Elevation: " + ElevationType.ToString()); info.AppendLine("Working set: " + Utils.FormatSize(Environment.WorkingSet)); diff --git a/trunk/ProcessHacker/Program/Save.cs b/trunk/ProcessHacker/Program/Save.cs index adb21907e..41d667ee4 100644 --- a/trunk/ProcessHacker/Program/Save.cs +++ b/trunk/ProcessHacker/Program/Save.cs @@ -106,7 +106,7 @@ namespace ProcessHacker StringBuilder sb = new StringBuilder(); sb.AppendLine("Process Hacker version " + Application.ProductVersion); - sb.AppendLine(Environment.OSVersion.ToString() + " (" + OSVersion.BitsString + ")"); + sb.AppendLine(OSVersion.VersionString + " (" + OSVersion.BitsString + ")"); return sb.ToString(); }