Fix parsing of Win10 product names from registry

This commit is contained in:
YoshiRulz 2021-10-20 13:39:31 +10:00
parent e38726db50
commit 9220cf675e
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ namespace BizHawk.Common
{
using var proc = ConstructSubshell("REG", $@"QUERY ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"" /V {key}");
proc.Start();
return proc.StandardOutput.ReadToEnd().Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(new[] { '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries)[2];
return proc.StandardOutput.ReadToEnd().Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(new[] { "\t", " " }, StringSplitOptions.RemoveEmptyEntries)[2];
}
if (CurrentOS != DistinctOS.Windows) return null;
var rawWinVer = float.Parse(GetRegValue("CurrentVersion"), NumberFormatInfo.InvariantInfo); // contains '.' even when system-wide decimal separator is ','