Repository navigation
Enhancement add 26 h2 tag - #196
Merged
Merged
Conversation
Contributor
👀 Heads Up — Manual Review RequiredHi @Magnetarman, However, the automated check detected that one or more sensitive WinToolkit files were modified, which affect the user interface, the main template or the project's static resources: Sensitive files modified
Why this notice?These files are not blocked for contributors, but they require additional verification by the maintainer before merging, because unexpected changes could:
Next stepsNo action is required from you. The maintainer will review the changes with extra care before merging. Automated notification from the WinToolkit CI/CD system — PR #196. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows version recognition consolidation (25H2 / 26H1 / 26H2)
Description
Windows release labels (
24H2,25H2,26H1,26H2, …) were derived only from the OS build number through>=-thresholds, with the mapping duplicated across several places.This caused two real defects:
26300) WinToolkit reported25H2, because26300 >= 26200matched the 25H2 threshold and the map had no26300 -> 26H2entry.24H2, because the header map lacked the26200 -> 25H2entry.The build-number approach is also fundamentally fragile: 26H1 ships on build
28000while 26H2 ships on26300(different platform branches,BrominevsGermanium), so the build-number order no longer matches the release-order, and every new release requires a manual map patch.Fix — single source of truth inside
wintoolkit-modulesAll version logic now lives in
wintoolkit-modules/40-Module.System.ps1:Get-WindowsDisplayVersion— authoritative detection, evaluated in this order:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion(authoritative on Windows 11 21H2+ and automatically future-proof — a27H1release needs no code change).ReleaseIdonly on build< 22000(Windows 10). The staleReleaseId = 2009shipped on every Windows 11 build is therefore ignored.28000 = 26H1; 26300 = 26H2; 26200 = 25H2; 26100 = 24H2; 22631 = 23H2; 22621 = 22H2; 22000 = 21H2; …Get-WindowsCompatibility— maps the build number to a logical tier (Windows11/Windows10/Windows81/Unsupported) used for the support/compatibility indicator.The Terminal (
30-Module.Logging.ps1 Start-ToolkitLog,80-Module.UserInteraction.ps1 WinOSCheck) and the GUI now only read and display the already-interpreted value:Start-ToolkitLogcallsGet-WindowsDisplayVersion -Build $build(its localverMapwas removed).WinOSCheckselects its message from$si.Compatibilityinstead of comparing build numbers.WinToolkit_GUI.ps1Update-SystemInformationPanelrenders the green / yellow / red LED and label from$si.Compatibility(it no longer evaluates build thresholds).As a result, adding a future release label means updating one place (the registry first, the fallback map only if needed), and the GUI performs no version interpretation at all.
Bug fix for the reported mis-detection of 26H2 as 25H2, plus correct recognition of 25H2.
Fixes # (no linked issue)
Type of Change
Files Modified
Source modules (single source of truth):
wintoolkit-modules/40-Module.System.ps1— addedGet-WindowsDisplayVersion(registry-first, with corrected build fallback covering 26H1/26H2/25H2 and future-proof via theDisplayVersionregistry value) andGet-WindowsCompatibility;Get-SystemInfonow returnsDisplayVersionand a logicalCompatibilityfield.wintoolkit-modules/30-Module.Logging.ps1—Start-ToolkitLogusesGet-WindowsDisplayVersion(removed the duplicatedverMap).wintoolkit-modules/80-Module.UserInteraction.ps1—WinOSCheckselects its compatibility message from$si.Compatibilityinstead of build thresholds.Presentation layer (display only):
WinToolkit_GUI.ps1—Update-SystemInformationPanelrenders the compatibility tier from$si.Compatibility(green/yellow/red LED + text); no build-number interpretation remains.Generated artifact (rebuilt, not hand-edited — per repo policy):
WinToolkit.ps1— regenerated bycompiler.ps1(commit✅ Build WinToolkit) so the compiled core reflects the module changes. Not edited manually.Tests & Verification
compiler.ps1and confirmed parse + behaviorEnvironment: Windows 11 Pro 26H2 (build
26300.9457), PowerShell 7.6.6.Checklist
Dev(commits are on theDevbranch)WinToolkit.ps1not modified manually (handled by CI automation — rebuilt withcompiler.ps1)WinToolkit.ps1,start-core.ps1) are not edited manually.github/,start.ps1orstart-modules/(so no extra maintainer review required there)