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

Add OS.get_version_alias() to return a human-readable Windows/macOS version number #100372

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Dec 13, 2024

Windows 11's major version number is actually 10.x.x, which can be confusing if you don't know about this quirk. OS.get_version_alias() avoids this by displaying the "branding" version number and the build number as a suffix, so that individual updates can still be distinguished from each other.

On macOS, OS.get_version_alias() returns the version number prepended with the version name (e.g. Sequoia for macOS 15).

On other operating systems, this returns the same value as OS.get_version().

Preview

Various uses of Copy System Info when running under WINE, using winecfg to modify the Windows version reported to applications:

Godot v4.4.dev (7f5c46929) - Windows 11 (build 22000) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Godot v4.4.dev (7f5c46929) - Windows 10 (build 19043) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Godot v4.4.dev (7f5c46929) - Windows Server 2008 R2 (build 7601) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Godot v4.4.dev (7f5c46929) - Windows 8.1 (build 9600) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Godot v4.4.dev (7f5c46929) - Windows 8 (build 9200) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Godot v4.4.dev (7f5c46929) - Windows 7 (build 7601) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)

# The only time you'll see Windows 2.0 able to run Godot :)
Godot v4.4.dev (7f5c46929) - Windows Unknown (build 0) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)

winecfg doesn't have options to report Windows Server 2016, 2019, 2022 or 2025 as of wine-staging 9.15, so I've based the detection on this information.

TODO

  • Test on macOS.
    • Is there a way to get the human-readable version directly from the OS? This way, we can support future OS versions without having to update Godot.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS code seems to be working as expected (only tested on current version).

@Calinou Calinou force-pushed the os-add-get-version-alias branch 2 times, most recently from 275d73b to a239fc7 Compare December 13, 2024 17:34
… version number

Windows 11's major version number is actually 10.x.x, which can be confusing
if you don't know about this quirk. `OS.get_version_alias()` avoids this
by displaying the "branding" version number and the build number as a suffix,
so that individual updates can still be distinguished from each other.

On macOS, `OS.get_version_alias()` returns the version number prepended
with the version name (e.g. Sequoia for macOS 15).

On other operating systems, this returns the same value as `OS.get_version()`.
@Calinou Calinou force-pushed the os-add-get-version-alias branch from a239fc7 to 9289828 Compare December 14, 2024 17:47
@akien-mga akien-mga modified the milestones: 4.x, 4.4 Dec 16, 2024
@Repiteo Repiteo merged commit a7fa052 into godotengine:master Dec 16, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 16, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OS::get_version_alias()
5 participants