Skip to content

Commit

Permalink
Merge pull request #1292 from gmartin7/BL-12665Win11ErrorRpt
Browse files Browse the repository at this point in the history
BL-12665 Detect Win11 in error reports (#1292)

Co-Authored-By: Gordon Martin <[email protected]>
  • Loading branch information
andrew-polk and Gordon Martin authored Oct 11, 2023
2 parents 36b8d09 + 2a54cd1 commit 591a664
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- [SIL.Core] Enhanced ErrorReport.GetOperatingSystemLabel method to report Windows 11+ and list the version as well.
- [SIL.Core] Enhanced RetryUtility.Retry methods to optionally improve debugging messages, and fixed existing RobustFile and RobustIO methods to use the new optional debugging parameter
- [SIL.Media] Changed the FrameRate reported in VideoInfo from FrameRate to AvgFrameRate.
- [SIL.Windows.Forms] Fixed spelling error in ImageGalleryControl, renaming SetIntialSearchTerm to SetInitialSearchTerm.
Expand Down
9 changes: 8 additions & 1 deletion SIL.Core/Reporting/ErrorReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ public static string GetOperatingSystemLabel()
foreach (var version in list)
{
if (version.Match(Environment.OSVersion))
return version.Label + " " + Environment.OSVersion.ServicePack;
{
// From: https://stackoverflow.com/questions/69038560/detect-windows-11-with-net-framework-or-windows-api
if (version.Label == "Windows 10" && Environment.OSVersion.Version.Build >= 22000)
{
return "Windows 11+ " + Environment.OSVersion.ServicePack + " (" + Environment.OSVersion.Version + ")";
}
return version.Label + " " + Environment.OSVersion.ServicePack + " (" + Environment.OSVersion.Version + ")";
}
}

// Handle any as yet unrecognized (possibly unmanifested) versions, or anything that reported its self as Windows 8.
Expand Down

0 comments on commit 591a664

Please sign in to comment.