(GUI): adjusted TroubleShootingDialog.GetOSVersion.

This commit is contained in:
morkt 2018-01-30 16:37:14 +04:00
parent ebbac01c40
commit 978da7fe92

View File

@ -69,18 +69,14 @@ namespace GARbro.GUI
internal static string GetOSVersion () internal static string GetOSVersion ()
{ {
string id = Registry.GetValue (@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", "").ToString(); string id = Registry.GetValue (@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", "").ToString();
if (string.IsNullOrEmpty (id)) if (string.IsNullOrEmpty (id))
id = Environment.OSVersion.VersionString;
else
{ {
id = Registry.GetValue (@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", "").ToString(); string sp = Environment.OSVersion.ServicePack;
if (string.IsNullOrEmpty (id)) if (!string.IsNullOrEmpty (sp))
id = Environment.OSVersion.VersionString; id += ' '+sp;
else
{
string sp = Environment.OSVersion.ServicePack;
if (!string.IsNullOrEmpty (sp))
id += ' '+sp;
}
} }
return id; return id;
} }