Opened 7 months ago
Last modified 7 months ago
#23619 new defect
Wrong OS Build number
Reported by: | t-matsuu | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | windows OS Build number | Cc: |
Description
What steps will reproduce the problem?
- Start JOSM on Windows 11 23H2 with OS build 22631.3447
- Help -> Show Status Report
- Check it
What is the expected result?
OS Build number: Windows 11 Pro 23H2 (22631)
What happens instead?
OS Build number: Windows 10 Pro 2009 (22631)
Please provide any additional information below. Attach a screenshot if possible.
If this dialog means a manual restart, the dialog message should be changed accordingly.
Revision:19039 Build-Date:2024-04-10 13:32:33 Identification: JOSM/1.5 (19039 ja) Windows 11 64-Bit OS Build number: Windows 10 Pro 2009 (22631) Memory Usage: 494 MB / 4006 MB (120 MB allocated, but free) Java version: 21.0.2+13-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920×1200 (scaling 1.25×1.25) Maximum Screen Size: 1920×1200 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: UTF-8 System property sun.jnu.encoding: MS932 Locale info: ja_JP Numbers with default locale: 1234567890 -> 1234567890 VM arguments: [-Djpackage.app-version=1.5.19039, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe] Plugins: + apache-commons (36176) + ejml (36176) + geotools (36176) + jackson (36176) + jaxb (36118) + jts (36004) + opendata (36200) + pmtiles (36219) + utilsplugin2 (36241) Tagging presets: + https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/JP.zip Map paint styles: + https://raw.githubusercontent.com/yopaseopor/traffic_signs_style_JOSM/master/Styles_Traffic_signs_PAC.zip - https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1 Last errors/warnings: - 00000.440 W: extended font config - overriding 'filename.Malgun_Gothic=malgun.ttf' with 'MALGUN.TTF' - 00000.442 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF' - 00000.443 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF' - 00000.889 E: java.security.KeyStoreException: Windows-ROOT not found. 原因: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
Attachments (4)
Change History (13)
by , 7 months ago
Attachment: | winver.JPG added |
---|
comment:1 by , 7 months ago
I agree this is misleading. One expects to find the information that is displayed by Windows tools like WinVer.
I guess we just have to change the evaluation of some registry variables in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion:
CurrentBuild
is "19045"
DisplayVersion
is "22H2"
ProductName
is "Windows 10 Pro"
UBR
is 0x10c3 (=4291)
WinREVersion
is "10.0.19041.3920"
comment:2 by , 7 months ago
Registry variables on my PC:
CurrentBuild
is "22631"
DisplayVersion
is "23H2"
ProductName
is "Windows 10 Pro"
UBR
is 0x00000d77 (=3447)
WinREVersion
is not set
This seems to be a well-known problem.
https://techcommunity.microsoft.com/t5/windows-11/windows-11-registry-still-reports-windows-10-as-os-name/m-p/2812649
comment:3 by , 7 months ago
I'll attach a patch which changes the line in the status report to look like this on my machine.
OS Build number: Windows 10 Pro 22H2 (19045)
by , 7 months ago
Attachment: | 23619.patch added |
---|
prefer to show key SOFTWARE
Microsoft
Windows NT
CurrentVersion\DisplayVersion
comment:4 by , 7 months ago
... Why have only one version when you can have hundreds? ...
Maybe add from the link:
if (Environment.OSVersion.Version.Build >= 22000) { // Windows 11 case declared as Windows 10. os = os.Replace("10", "11"); }
comment:5 by , 7 months ago
Keywords: | windows OS Build number added |
---|
comment:6 by , 7 months ago
I kind of ignored this because Windows was intentionally returning Windows 10. And we get Windows 11 elsewhere.
Identification: JOSM/1.5 (19039 ja) Windows 11 64-Bit OS Build number: Windows 10 Pro 2009 (22631)
Identification uses Version#getAgentString
which uses PlatformHook#getOSDescription
which uses the os.name
property.
OS Build number uses PlatformHook#getOSBuildNumber
which in turn uses PlatformHook#getProductName
. This reads from the registry, and is where we encounter this problem. We could rewrite getProductName
to just get the os.name
property instead.
comment:7 by , 7 months ago
I think GerdP's patch sounds sensible. Gives more information. And when the UserAgent is ok I think that's enough.
by , 7 months ago
Attachment: | 23619-2.patch added |
---|
get Windows Version via getSystemProperty("os.name")
instead of getProductName()
comment:9 by , 7 months ago
The comment above should be "get OS name" instead of "get Windows Version"
I thought I would prefer to show something similar to the WinVer dialog:
Version 22H2 (Build 19045.4291)
or mabybe just
Version 22H2 (19045)
because we seem to have no code yet to extract dword values like UBR
from registry
but the japanese Version of the dialog seems to contain a very different string containing OS and build (If I got it right ビルド
is Japanese for build
)
Since the status report is more for the developers than the user I think we wouldn't want partly translated information here?
Output from WinVer