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

SystemInfo: Add support for Windows Server 2025 (UI like Windows 11, Windows 11 core) #916

Closed
VISTALL opened this issue Nov 25, 2024 · 9 comments
Milestone

Comments

@VISTALL
Copy link

VISTALL commented Nov 25, 2024

For now Windows Server 2025 works like Windows 10 (no round corners, etc)

OpenJDK bug

https://bugs.openjdk.org/browse/JDK-8340387
openjdk/jdk@34cddfb

  os.arch = amd64
  os.name = Windows Server 2022
  os.version = 10.0
@VISTALL
Copy link
Author

VISTALL commented Nov 25, 2024

@DevCharly
Copy link
Collaborator

Thanks for the info.

I wonder why is your app in compatibility mode?

@VISTALL
Copy link
Author

VISTALL commented Nov 27, 2024

For example if jdk don't known about new OS - and getVersionEx will return last combability version. Without manifest will be windows 8. Based on manifest (without changing settings)

@VISTALL
Copy link
Author

VISTALL commented Nov 27, 2024

https://stackoverflow.com/questions/58294262/getversionex-windows-10-detected-as-windows-8

You can search it like GetVersionEx return wrong version - it's a pain function :(

@DevCharly
Copy link
Collaborator

Well, the actual problem is that your app consulo64.exe does not specify compatibility for Windows 10+ in its Windows manifest.

Manifest of consulo64.exe 3659 is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

On the other hand , the manifest of javaw.exe contains <compatibility> tag (and also dpiAwareness):
https://github.com/openjdk/jdk/blob/master/src/java.base/windows/native/launcher/java.manifest

If I patch consulo's manifest into a copy of javaw.exe, then GetVersionEx indeed returns 6.2.9200 (instead of 10.0.26100):

mt.exe "-inputresource:consulo64.exe;#1" -out:consulo64-manifest.txt
mt.exe "-outputresource:javawCopy.exe;#1" -manifest consulo64-manifest.txt

I would recommend to specify compatibility (and dpi awareness!) in your app.
There may be other Win32 API that behaves differently if Windows 10+ compatibility is not specified.

Anyway, here is a test version of the FlatLaf DLLs that use RtlGetVersion,
which returns correct Windows version even if manifest misses compatibility information:
flatlaf-windows-RtlGetVersion.zip

This DLLs output version to console. E.g.:

GetVersionEx:      6.2.9200
RtlGetVersion:     10.0.26100
KUSER_SHARED_DATA: 10.0.26100

or

GetVersionEx:      10.0.26100
RtlGetVersion:     10.0.26100
KUSER_SHARED_DATA: 10.0.26100

If these DLLs work for you, I'll integrate it into official DLLs.

BTW interesting article regarding Windows version detection:
https://www.codeproject.com/Articles/5336372/Windows-Version-Detection

@VISTALL
Copy link
Author

VISTALL commented Nov 28, 2024

Hello. Thanks. I will test it. You are right about manifest - but not all apps contains it (support for last OSes). Need correct way for getting real version - because even JVM use real version of OS, not combability version

@DevCharly
Copy link
Collaborator

8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a in manifest makes it compatible with Windows 10, Windows 11, Windows Server 2016, Windows Server 2019 and Windows Server 2022 (source).

@VISTALL
Copy link
Author

VISTALL commented Nov 28, 2024

Works as expected. No need override os.name :)

DevCharly added a commit that referenced this issue Nov 28, 2024
…t specify Windows 10+ compatibility in application manifest (issue #916)

Windows binaries built and signed locally in clean workspace
@DevCharly
Copy link
Collaborator

Fixed in latest 3.5.3-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 3.5.3 milestone Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants