Modify

Opened 3 weeks ago

Last modified 3 weeks 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?

  1. Start JOSM on Windows 11 23H2 with OS build 22631.3447
  2. Help -> Show Status Report
  3. 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)

winver.JPG (32.6 KB ) - added by GerdP 3 weeks ago.
Output from WinVer
screenshot.png (36.8 KB ) - added by t-matsuu 3 weeks ago.
Winver screenshot
23619.patch (1.9 KB ) - added by GerdP 3 weeks ago.
prefer to show key SOFTWARE Microsoft Windows NT CurrentVersion\DisplayVersion
23619-2.patch (694 bytes ) - added by GerdP 3 weeks ago.
get Windows Version via getSystemProperty("os.name") instead of getProductName()

Download all attachments as: .zip

Change History (13)

by GerdP, 3 weeks ago

Attachment: winver.JPG added

Output from WinVer

comment:1 by GerdP, 3 weeks ago

I agree this is misleading. One expects to find the information that is displayed by Windows tools like WinVer.
Output from 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"

by t-matsuu, 3 weeks ago

Attachment: screenshot.png added

Winver screenshot

comment:2 by t-matsuu, 3 weeks ago

Winver screenshot
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 GerdP, 3 weeks 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 GerdP, 3 weeks ago

Attachment: 23619.patch added

prefer to show key SOFTWARE
Microsoft
Windows NT
CurrentVersion\DisplayVersion

comment:4 by stoecker, 3 weeks 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 skyper, 3 weeks ago

Keywords: windows OS Build number added

comment:6 by taylor.smock, 3 weeks 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 stoecker, 3 weeks ago

I think GerdP's patch sounds sensible. Gives more information. And when the UserAgent is ok I think that's enough.

comment:8 by GerdP, 3 weeks ago

In 19041/josm:

see #23619: prefer to show key SOFTWARE\Microsoft\Windows\NT\CurrentVersion\DisplayVersion

by GerdP, 3 weeks ago

Attachment: 23619-2.patch added

get Windows Version via getSystemProperty("os.name") instead of getProductName()

comment:9 by GerdP, 3 weeks 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?

Last edited 3 weeks ago by GerdP (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to t-matsuu.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.