SEBWIN-558: Added Windows 11 to system info and supported OS list.

This commit is contained in:
Damian Büchel 2022-03-28 21:04:31 +02:00
parent 172845b3c0
commit 291c107fdd
4 changed files with 17 additions and 6 deletions

View file

@ -19,7 +19,7 @@
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 --> <!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 --> <!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application> </application>
</compatibility> </compatibility>

View file

@ -19,7 +19,7 @@
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 --> <!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 --> <!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application> </application>
</compatibility> </compatibility>

View file

@ -17,6 +17,7 @@ namespace SafeExamBrowser.SystemComponents.Contracts
Windows7, Windows7,
Windows8, Windows8,
Windows8_1, Windows8_1,
Windows10 Windows10,
Windows11
} }
} }

View file

@ -97,6 +97,7 @@ namespace SafeExamBrowser.SystemComponents
// assembly needs to define an application manifest where the supported Windows versions are specified! // assembly needs to define an application manifest where the supported Windows versions are specified!
var major = Environment.OSVersion.Version.Major; var major = Environment.OSVersion.Version.Major;
var minor = Environment.OSVersion.Version.Minor; var minor = Environment.OSVersion.Version.Minor;
var build = Environment.OSVersion.Version.Build;
// See https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions for mapping source... // See https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions for mapping source...
if (major == 6) if (major == 6)
@ -116,7 +117,14 @@ namespace SafeExamBrowser.SystemComponents
} }
else if (major == 10) else if (major == 10)
{ {
OperatingSystem = OperatingSystem.Windows10; if (build < 22000)
{
OperatingSystem = OperatingSystem.Windows10;
}
else
{
OperatingSystem = OperatingSystem.Windows11;
}
} }
} }
@ -132,6 +140,8 @@ namespace SafeExamBrowser.SystemComponents
return "Windows 8.1"; return "Windows 8.1";
case OperatingSystem.Windows10: case OperatingSystem.Windows10:
return "Windows 10"; return "Windows 10";
case OperatingSystem.Windows11:
return "Windows 11";
default: default:
return "Unknown Windows Version"; return "Unknown Windows Version";
} }
@ -176,8 +186,8 @@ namespace SafeExamBrowser.SystemComponents
{ {
foreach (ManagementObject queryObj in results) foreach (ManagementObject queryObj in results)
{ {
using (queryObj) using (queryObj)
{ {
foreach (var property in queryObj.Properties) foreach (var property in queryObj.Properties)
{ {
if (property.Name.Equals("DeviceID")) if (property.Name.Equals("DeviceID"))