[PR #6101] [MERGED] Telemetry: the Windows version comes from the registry, not cmd /C ver #6653

Closed
opened 2026-11-03 06:24:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6101
Author: @Domanffe
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/windows-version-from-registry


📝 Commits (1)

  • f3b1922 Telemetry: the Windows version comes from the registry, not cmd /C ver

📊 Changes

3 files changed (+58 additions, -3 deletions)

View changed files

📝 crates/horizon-bench/src/hardware.rs (+1 -1)
📝 crates/horizon-client-render/src/crash.rs (+1 -1)
📝 crates/horizon-telemetry/src/system.rs (+56 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

Fixes #6074

cmd /C ver prints "Version" in the Windows display language, in the console's
OEM code page. Read as UTF-8 that text carries U+FFFD where a non-ASCII letter
was, and the same Windows build shows up as a different os_version per
display language. The telemetry store keys a system row on
(os, os_version, ...), so one machine's reports split in two.

This reads the build from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
instead: CurrentBuild (REG_SZ, decimal) and UBR (REG_DWORD, hex), both
ASCII whatever the display language. The three readers that ran ver now call
one helper in horizon-telemetry:

  • crates/horizon-telemetry/src/system.rs, System.os_version.
  • crates/horizon-bench/src/hardware.rs, hardware.os_version.
  • crates/horizon-client-render/src/crash.rs, the crash report's OS line.

The string becomes Windows 11 (26100.2033); build 22000 is the first Windows
11. Nothing else in the repo parses it, as the issue notes.

Measured on this Windows 11 machine:

  • cmd /C ver -> Microsoft Windows [Version 10.0.26200.9818]
  • reg query ... /v CurrentBuild -> 26200, /v UBR -> 0x265a (9818)
  • the new string -> Windows 11 (26200.9818)

the_windows_version_comes_from_the_build_numbers pins both reg query reply
shapes, the hex revision and the 10/11 split.

What I did not check: I cannot switch this machine's display language, so the
Spanish output from #5201 was not re-run through the new reader. The fix avoids
that text instead of decoding it. A missing or renamed registry value leaves
os_version empty rather than wrong.

The pr_ready block follows as a comment.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6101 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/windows-version-from-registry` --- ### 📝 Commits (1) - [`f3b1922`](https://github.com/horizon-rust/horizon/commit/f3b1922606f8b2fe13f783a8a71397d884914603) Telemetry: the Windows version comes from the registry, not `cmd /C ver` ### 📊 Changes **3 files changed** (+58 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-bench/src/hardware.rs` (+1 -1) 📝 `crates/horizon-client-render/src/crash.rs` (+1 -1) 📝 `crates/horizon-telemetry/src/system.rs` (+56 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. Fixes #6074 `cmd /C ver` prints "Version" in the Windows display language, in the console's OEM code page. Read as UTF-8 that text carries U+FFFD where a non-ASCII letter was, and the same Windows build shows up as a different `os_version` per display language. The telemetry store keys a system row on `(os, os_version, ...)`, so one machine's reports split in two. This reads the build from `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion` instead: `CurrentBuild` (`REG_SZ`, decimal) and `UBR` (`REG_DWORD`, hex), both ASCII whatever the display language. The three readers that ran `ver` now call one helper in `horizon-telemetry`: - `crates/horizon-telemetry/src/system.rs`, `System.os_version`. - `crates/horizon-bench/src/hardware.rs`, `hardware.os_version`. - `crates/horizon-client-render/src/crash.rs`, the crash report's OS line. The string becomes `Windows 11 (26100.2033)`; build 22000 is the first Windows 11. Nothing else in the repo parses it, as the issue notes. Measured on this Windows 11 machine: - `cmd /C ver` -> `Microsoft Windows [Version 10.0.26200.9818]` - `reg query ... /v CurrentBuild` -> `26200`, `/v UBR` -> `0x265a` (9818) - the new string -> `Windows 11 (26200.9818)` `the_windows_version_comes_from_the_build_numbers` pins both `reg query` reply shapes, the hex revision and the 10/11 split. What I did not check: I cannot switch this machine's display language, so the Spanish output from #5201 was not re-run through the new reader. The fix avoids that text instead of decoding it. A missing or renamed registry value leaves `os_version` empty rather than wrong. The `pr_ready` block follows as a comment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:24:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6653
No description provided.