siliconman01 wrote: ↑January 18th, 2023, 2:13 pm
You are most likely correct. My Win11 systems were originally Win10 updated by Windows Update.
I changed the last line in both the Win10 and Win11 code to:
Text=[MeasureProductName] [MeasureWinBits]-bit Version [MeasureReleaseID] (OS Build [MeasureCurrentBuild].[MeasureUBR])
This makes the display emulate the standard Windows WinVer app.
WinVer.pngWin11.pngWin10.png
Looks good! Keep in mind though that the code will probably need the adjustment I mentioned earlier if you ever run the skin on a system where Win 11 was installed in a clean fashion (i.e. no upgrade), because the registry path you used could miss from such a system. Something like - and this is just one way of doing it:
Code: Select all
[Variables]
ProductNumber="\2"
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureCurrentBuild]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentBuild
UpdateDivider=-1
IfCondition=(MeasureCurrentBuild>=22000)
IfTrueAction=[!SetVariable ProductNumber "11"]
[MeasureProductName]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=ProductName
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^(.*?)(\d+)(.*?)$":"\1#ProductNumber#\3"
DynamicVariables=1
[MeasureReleaseID]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=DisplayVersion
UpdateDivider=-1
[MeasureUBR]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=UBR
UpdateDivider=-1
[MeasureWinBits]
Measure=String
String=%ProgramFiles(x86)%
RegExpSubstitute=1
Substitute="^(.+)$":"64","^$":"32"
UpdateDivider=-1
[MeterVersion]
Meter=String
FontSize=11
FontWeight=700
FontColor=126,228,68,255
SolidColor=0,0,0,255
SolidColor2=64,32,0,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[MeasureProductName] [MeasureWinBits]-bit Version [MeasureReleaseID] (OS Build [MeasureCurrentBuild].[MeasureUBR])
Basically, in
[MeasureProductName] we substitute the first number (since
.*? means, when it comes to
regular expressions, every character any number of times but as few as possible, and
\d+ means any digit more than once) with the value of the
ProductNumber variable.
The value of the product number variable will be either the default
\2 (corresponding to the 2nd capture from the original product name, aka the
(\d+) in the regular expression pattern), or
11 if
[MeasureCurrentBuild] is greater than or equal to 22000 (we perform this test in the IfCondition from the current build measure, and since we need that result before we move on to the product name measure, we placed the former before the latter in the code).
For the record, if the IfCondition was executing before the Substitute (can't remember if that's the case here), we could have placed both in the product name measure, but then, better be on the safe side and leave them where they make more sense.
Note to myself: Adjust the code in my corresponding skin as well. If I decide to bother to correct the MS slip ups, that is.