It is currently July 18th, 2019, 12:02 pm

WINVER

General topics related to Rainmeter.
Questor
Posts: 1
Joined: December 25th, 2018, 2:08 pm

WINVER

Questor » December 25th, 2018, 2:20 pm

I want the full WINVER to show in my "Rainmeter-box". Somthing like this:
WINVER = Windows 10 version 1803 (OS-build 17134.471) 64-bit

How do I mange it?

Regards Mr.Q
User avatar
CyberTheWorm
Posts: 651
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: WINVER

CyberTheWorm » December 25th, 2018, 4:20 pm

That program has nothing to do with rainmeter so if you want to change it you might want to learn how program in Windows
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
balala
Rainmeter Sage
Posts: 8369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: WINVER

balala » December 25th, 2018, 4:46 pm

Questor wrote:
December 25th, 2018, 2:20 pm
I want the full WINVER to show in my "Rainmeter-box". Somthing like this:
WINVER = Windows 10 version 1803 (OS-build 17134.471) 64-bit

How do I mange it?
You can do this, using the RunCommand plugin. For example:

Code: Select all

[Rainmeter]
Update=-1
DynamicWindowSize=1
AccurateText=1

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
State=Hide
OutputType=ANSI
OutputFile=#CURRENTPATH#CPUName.txt
FinishAction=[!DisableMouseAction MeterRun "LeftMouseUpAction"][!SetOption MeterRun Text "%1"][!UpdateMeter "MeterRun"][!Redraw]

[MeterRun]
Meter=STRING
MeasureName=MeasureRun
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Get Windows version
LeftMouseUpAction=[!CommandMeasure MeasureRun "Run"]
Yincognito
Posts: 653
Joined: February 27th, 2015, 2:38 pm

Re: WINVER

Yincognito » January 2nd, 2019, 4:40 pm

Questor wrote:
December 25th, 2018, 2:20 pm
I want the full WINVER to show in my "Rainmeter-box". Somthing like this:
WINVER = Windows 10 version 1803 (OS-build 17134.471) 64-bit

How do I mange it?

Regards Mr.Q
A better (and less resource intensive) way would be to just query the keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion from the Windows registry (run regedit.exe and paste the above path in the editbox at the top to see those keys). There's even a specific example in Rainmeter's manual about it, using the Registry measure. :D

Relevant keys that could be passed to the RegValue option of the Registry measure include ProductName, ReleaseId, EditionID, CurrentBuildNumber, CurrentBuild, BuildLabEx, and even CSDVersion if you want to get the service pack number of a Windows OS prior to Windows 10.

The only thing this is not getting is the 471 minor build version, but then, balala's answer isn't getting that either (and neither does WMIC command line), as far as I can see. I'm sure there is a relatively easy way of getting that as well, if you look close enough into the matter...
User avatar
jsmorley
Developer
Posts: 19287
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WINVER

jsmorley » January 2nd, 2019, 4:54 pm

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

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

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

[MeterVersion]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[MeasureProductName] Version [MeasureReleaseID] Build [MeasureCurrentBuild].[MeasureUBR] Architecture [MeasureWinBits]-bit
1.jpg
You do not have the required permissions to view the files attached to this post.
Yincognito
Posts: 653
Joined: February 27th, 2015, 2:38 pm

Re: WINVER

Yincognito » January 3rd, 2019, 10:41 am

jsmorley wrote:
January 2nd, 2019, 4:54 pm

Code: Select all

[MeasureUBR]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=UBR
UpdateDivider=-1
Oh, thanks, jsmorley, it seems you can get the minor build number too - I don't know how I could miss that (maybe because it was the last key there)...

EDIT: Just for the record, the minor build number can also be found at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\CSDBuildNumber - interestingly, CSDVersion from the same path was used to store Windows XP's service pack number, so it might be for some strange Windows 10 backward compatibility reason...
jsmorley wrote:
January 2nd, 2019, 4:54 pm

Code: Select all

[MeasureWinBits]
Measure=String
String=%ProgramFiles(x86)%
RegExpSubstitute=1
Substitute="^(.+)$":"64","^$":"32"
UpdateDivider=-1
Or ...

Code: Select all

[MeasureWinBits]
Measure=Plugin
Plugin=SysInfo
SysInfoType=OS_BITS
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(^\s+|\s+$)":"","^(\S{1,3}).*$":"\1-bit","(^$|^0$)":"N/A-bit"
This whole thing actually benefits my skins too - I was just about to review my System skin, to query the new Win10 specific keys as well. ;-)