It is currently October 21st, 2019, 4:12 am

SysInfo Vs. Registry

Tips and Tricks from the Rainmeter Community
User avatar
jsmorley
Developer
Posts: 19591
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

SysInfo Vs. Registry

jsmorley » July 18th, 2015, 3:36 pm

As you might have heard, Windows 10 is going to be releasing very soon. I wanted to point out one little "gotcha" with the new version of Windows and the SysInfo plugin, and a decent alternative.

The SysInfoType of OS_VERSION doesn't yet work right with Windows 10, as the function call used to get the version has not been updated by Microsoft yet. As of now, it will return "Windows 8.1" for Windows 10. This might be corrected before the final release of Windows 10, or it might take some time after.

Having said that, there is a reliable and somewhat more robust way to get Windows "version" information anyway. That is using the Registry measure rather than the SysInfo plugin.

Code: Select all

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

[MeasureMajorVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentMajorVersionNumber

[MeasureMinorVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentMinorVersionNumber

[MeasureCurrentBuild]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentBuild

[MeasureProducName]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=ProductName

[MeasureEditionID]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=EditionID

[MeasureCurrentVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentVersion

[MeterBack]
Meter=Image
W=([MeterProductName:X] + [MeterProductName:W] + 5)
H=140
SolidColor=47,47,47,255
DynamicVariables=1

[MeterVersionNumbers]
Meter=String
MeasureName=MeasureMajorVersion
MeasureName2=MeasureMinorVersion
FontSize=11
FontColor=255,255,255,255
Padding=5,5,5,5
AntiAlias=1
Text=Version Name: 	  Windows %1.%2

[MeterProductName]
Meter=String
MeasureName=MeasureProducName
Y=2R
FontSize=11
FontColor=255,255,255,255
Padding=5,5,5,5
AntiAlias=1
Text=Product Name: 	  %1

[MeterEditionId]
Meter=String
MeasureName=MeasureEditionID
Y=2R
FontSize=11
FontColor=255,255,255,255
Padding=5,5,5,5
AntiAlias=1
Text=Edition Name:	   %1

[MeterCurrentBuild]
Meter=String
MeasureName=MeasureCurrentBuild
Y=2R
FontSize=11
FontColor=255,255,255,255
Padding=5,5,5,5
AntiAlias=1
Text=Build Number:	   %1

[MeterCurrentVersion]
Meter=String
MeasureName=MeasureCurrentVersion
Y=2R
FontSize=11
FontColor=255,255,255,255
Padding=5,5,5,5
AntiAlias=1
Text=Version Number:	   %1
OnUpdateAction=[!UpdateMeter MeterBack][!Redraw]
1.jpg
You do not have the required permissions to view the files attached to this post.