It is currently July 27th, 2024, 8:57 am

How to display Windows build version in Tooltip?

Get help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 1451
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

How to display Windows build version in Tooltip?

Post by sl23 »

In the Rainmeter About window, I noticed these are shown, but I wondered if it were possible to show these in the Tooltip I have set up.
I can't seem to find anything about it in the forum or Manual. Maybe I'm using the wrong terms?

So, what I am looking to add is in bold:
Win 11 23H2 (build 22631.3447) 64-bit

Thanks :thumbup:
- MuLab -
User avatar
balala
Rainmeter Sage
Posts: 16423
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to display Windows build version in Tooltip?

Post by balala »

sl23 wrote: May 16th, 2024, 1:26 pm In the Rainmeter About window, I noticed these are shown, but I wondered if it were possible to show these in the Tooltip I have set up.
I can't seem to find anything about it in the forum or Manual. Maybe I'm using the wrong terms?
Even if not entirely the required information, you can start by using a RunCommand plugin measure. For example this one:

Code: Select all

[WinVersion]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=cmd /c ver
State=Hide
OutputType=UTF8
RegExpSubstitute=1
Substitute="\n":""
If you add this measure, don't forget to run it, using any option you need / want. For instance you can add the following option to the [Rainmeter] section of your code: OnRefreshAction=[!CommandMeasure "WinVersion" "Run"]. When you have the information, you can use it into the TooltipText option of a meter (TooltipText=[WinVersion]).
User avatar
Yincognito
Rainmeter Sage
Posts: 7785
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to display Windows build version in Tooltip?

Post by Yincognito »

sl23 wrote: May 16th, 2024, 1:26 pm In the Rainmeter About window, I noticed these are shown, but I wondered if it were possible to show these in the Tooltip I have set up.
I can't seem to find anything about it in the forum or Manual. Maybe I'm using the wrong terms?

So, what I am looking to add is in bold:
Win 11 23H2 (build 22631.3447) 64-bit

Thanks :thumbup:
You can find most of the desired info in the registry (run regedit.exe to see it), in the following places:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SystemInformation
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
To get values of registry keys in Rainmeter, you'd use Registry measures:
https://docs.rainmeter.net/manual/measures/registry/
Various additional info can be interrogated by using SysInfo measures:
https://docs.rainmeter.net/manual/measures/sysinfo/
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1451
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: How to display Windows build version in Tooltip?

Post by sl23 »

Thanks for your replies :thumbup:

I'm just looking at how to implement the Registry keys that Yincognito specified. I then added balala's idea and added it as a ToolTip.
Neither seems to work, I assume because I need to change RegValue=ProductName in the second measure, but no idea why the ToolTip doesn't show:

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=0,0,0,255
OnRefreshAction=[!CommandMeasure "WinVersion" "Run"]

[MeasureWindowsVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=Software\Microsoft\Windows NT\CurrentVersion
RegValue=ProductName
UpdateDivider=-1

[MeasureWindowsBuild]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=CurrentControlSet\Control\SystemInformation
RegValue=ProductName
UpdateDivider=-1

[WinVersion]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=cmd /c ver
State=Hide
OutputType=UTF8
RegExpSubstitute=1
Substitute="\n":""

[MeterText]
Meter=String
MeasureName=MeasureWindowsVersion
MeasureName2=MeasureWindowsBuild
X=5
Y=5
H=25
FontColor=255,255,255,255
Text="Version: %1 %2"
TooltipText=[WinVersion]
But, on opening and looking up the key in RegEdit, I can't find anything related to windows build.
However, I searched the registry for 'build' and found this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows, but that again doesn't show the build numbers. How would I find these?

Thanks again.

EDIT:
I then changed the meter to this:

Code: Select all

[MeterText]
Meter=String
MeasureName=MeasureWindowsVersion
MeasureName2=MeasureWindowsBuild
MeasureName3=WinVersion
X=5
Y=5
H=25
FontColor=255,255,255,255
Text="Version: %1 %2"
ToolTipText=%3
Which gives me a ToolTip, but not quite what I was looking for: Microsoft Windows [Version 10.0.22631.3447] It doesn't display the version number, only the build number.
- MuLab -
User avatar
sl23
Posts: 1451
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: How to display Windows build version in Tooltip?

Post by sl23 »

Found this site that states what I am after is called DisplayVersion and BuildNumber. But I can't seem to get the skin to work correctly with any of the syntax posted here! No idea what I'm doing with cmd code! :oops:

Please help! :rosegift:

EDIT:
I tried executing these in Powershell directly and I get the info required, but when I add these to the skin section [WinVersion], I just get nonsense or errors. Why is that?
Here are the lines I've tried:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"| select ProductName, DisplayVersion, CurrentBuild

Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v DisplayVersion

Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId

cmd /c /v DisplayVersion
That last one is my attempt at several variations to get the info I want.

This one I figured out from here, and it just gives the DisplayVersion as a number only, which is what I want. But again, it works only in Powershell and not in Rainmeter.
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name DisplayVersion).DisplayVersion
- MuLab -
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5452
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to display Windows build version in Tooltip?

Post by eclectic-tech »

sl23 wrote: May 17th, 2024, 9:12 am {clip}
But I can't seem to get the skin to work correctly with any of the syntax posted here! No idea what I'm doing with cmd code! :oops:

Please help! :rosegift:
{clip}
Take a look at this post which seems to get all the details you want: https://forum.rainmeter.net/viewtopic.php?p=212378&hilit=win+version+build#p212373
User avatar
Yincognito
Rainmeter Sage
Posts: 7785
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to display Windows build version in Tooltip?

Post by Yincognito »

sl23 wrote: May 17th, 2024, 8:42 am I'm just looking at how to implement the Registry keys that Yincognito specified. [...]
Neither seems to work
I think eclectic-tech's link will help in that regard, since that thread contains various similar methods that you can try, including mine and balala's. In the previous post, I just copy pasted the registry paths that I successfully use on Win 10 to get that info in my skins, but it's possible that in Win 11 various locations are different, I don't know. Obviously, for some, the names are not exactly intuitive.

Personally, I always try to choose the method that is also fast and performant, so that's why I only use the PowerShell ones when there no other way of getting what I want. Naturally, that doesn't mean they're not valid, just a bit slow for my taste (even with just SSDs in my laptop eventually). :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16423
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to display Windows build version in Tooltip?

Post by balala »

sl23 wrote: May 16th, 2024, 1:26 pm So, what I am looking to add is in bold:
Win 11 23H2 (build 22631.3447) 64-bit
Taking into account what has been described on the link posted by eclectic-tech above, here is how can you get exactly what you asked for:

Code: Select all

[MeasureProductName]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=ProductName
UpdateDivider=-1
;Measure=Plugin
;Plugin=RunCommand
;OutputType=ANSI
;Program=PowerShell
;Parameter=(Get-WmiObject -class Win32_OperatingSystem).Caption
;Substitute="#CRLF#":""
;UpdateDivider=-1

[MeasureDisplayVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=DisplayVersion
UpdateDivider=-1

[MeasureCurrentBuild]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentBuild
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

[MeterText]
Meter=String
MeasureName=MeasureWindowsVersion
MeasureName2=MeasureWindowsBuild
MeasureName3=WinVersion
X=5
Y=5
H=25
FontColor=255,255,255,255
Text="Version: %1 %2"
ToolTipText=%3
TooltipText=[MeasureDisplayVersion] (build [MeasureCurrentBuild].[MeasureUBR])
DynamicVariables=1
What is most important here, besides the TooltipText, is the DynamicVariables=1, which was missing in your above codes as well. The Tooltip of those codes were not shown due to this missing option as well, I think.
User avatar
sl23
Posts: 1451
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: How to display Windows build version in Tooltip?

Post by sl23 »

Oh wow! Thanks eclectic-tech for the link! That should surely be in the manual, don't you think?
And thanks to Yincognito for the info. I agree with your methodology 100% :thumbup:
Thanks balala for going to the trouble of providing the code, you didn't need to go that far, so thanks for that. :great:
- MuLab -
User avatar
balala
Rainmeter Sage
Posts: 16423
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to display Windows build version in Tooltip?

Post by balala »

sl23 wrote: May 17th, 2024, 8:28 pm Thanks balala for going to the trouble of providing the code, you didn't need to go that far, so thanks for that. :great:
Glad to help, from my part, even if in this case eclectic-tech provided the proper link.