Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing newer OS versions #14

Closed
rcdailey opened this issue Jul 18, 2022 · 6 comments
Closed

Missing newer OS versions #14

rcdailey opened this issue Jul 18, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@rcdailey
Copy link

The OperatingSystem enum is missing a few:

  • Windows 11
  • Windows Server 2022
  • Windows Server 2019
@pruggit pruggit self-assigned this Jul 29, 2022
@pruggit pruggit added the enhancement New feature or request label Jul 29, 2022
@pruggit
Copy link
Contributor

pruggit commented Aug 3, 2022

Currently there is no official way provided by Microsoft, which allows to determine Windows 11 by using the version numbers. According to the Operating System Version documentation, Windows 11 and Windows 10 (and Windows Server 2016 through Windows Server 2022) are having the same version number 10.0. It seems, that for Microsoft it is more like a "platform version".

It might be because e.g. Windows 11 is just a marketing name and uses the basic system architecture of Windows 10.

As far as I know, the distinction can currently only be made based on the build number, where e.g Windows 11 has a number with 22000 or higher.

Nevertheless, the enums need an update regarding the Windows product names.

  • add OS detection strategy to readme file
  • define a method to reflect current and future Windows product names in the enums

@pruggit pruggit closed this as completed Aug 3, 2022
@pruggit pruggit reopened this Aug 3, 2022
@rcdailey
Copy link
Author

rcdailey commented Aug 3, 2022

Here is how I reasoned about the version numbers on my side. Granted some of this may be inaccurate or unreliable, but it seems to work in the testing I did.

public static OsVersionEnum GetVersionEnum()
{
    var ver = (OSVersion.MajorVersion, OSVersion.BuildNumber, OSVersion.IsServer);
    return ver switch
    {
        (< 10, _, false) => OsVersionEnum.PreWin10,
        (< 10, _, true) => OsVersionEnum.PreWin2019,
        (10, >= 22000, false) => OsVersionEnum.Win11,
        (10, < 22000, false) => OsVersionEnum.Win10,
        (10, >= 20000, true) => OsVersionEnum.Win2022,
        (10, >= 17763, true) => OsVersionEnum.Win2019,
        _ => OsVersionEnum.Unknown
    };
}

Note I only cared about a subset of OS versions in my business rules, so this switch expression is not comprehensive.

@daluu
Copy link

daluu commented Sep 14, 2022

This may be useful reference as well that I came across before: https://www.dell.com/support/kbdoc/en-gy/000193571/windows-11-incorrect-os-version-reported.

@pruggit
Copy link
Contributor

pruggit commented Sep 18, 2022

Here is an interesting discussion that shows what developers or administrators would like to have regarding versioning and what Microsoft thinks about it.

https://learn.microsoft.com/en-us/answers/questions/586619/windows-11-build-ver-is-still-10022000194.html?page=2&pageSize=10&sort=oldest

@DirectInput
Copy link

DirectInput commented Mar 2, 2023

Hi, I wanted to see if this was still being worked on? Thanks

@pruggit
Copy link
Contributor

pruggit commented Aug 9, 2023

Support for Windows 11 and Server 2022 have been added. #21

@pruggit pruggit closed this as completed Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants