It is currently April 26th, 2024, 2:56 am

String Measure failing to retrieve value from Registry Measure

Report bugs with the Rainmeter application and suggest features.
spd2last
Posts: 2
Joined: March 23rd, 2021, 4:37 am

String Measure failing to retrieve value from Registry Measure

Post by spd2last »

I'm rewriting portions of my skin to remove the HWiNFO plugin in exchange to read registry values. But something that I've come across, and that I can't find any info about online is the interaction between a Registry Measure and a String Measure. In the below code, the mSetIcon measure is throwing a 0 while the mHeading measure is correctly showing NVIDIA GeForce... I thought perhaps it was something with the order of operations, and tried some UpdateMeasure bangs, but no luck. This is exactly what I was doing before with mHeading containing the HWiNFO plugin information, and there's more substitution and things that occur within mSetIcon where it just wouldn't be clean to repeat the entire block of mHeading into mSetIcon. I have reduced mSetIcon to its most basic form for troubleshooting purposes...

Code: Select all

[mHeading]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=#HWiNFO-GPU_Label#
RegExpSubstitute=1
Substitute="^(.*]: )":"","(: .*)$":""
UpdateDivider=-1

[mSetIcon]
Measure=String
String=[mHeading]
In the About Rainmeter > Skins viewer, it shows mHeading = NVIDIA GeForce, mSetIcon = 0
Am I missing something obvious here? Should mSetIcon not be reporting the same string that mHeading is showing?
User avatar
Brian
Developer
Posts: 2684
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: String Measure failing to retrieve value from Registry Measure

Post by Brian »

Since you are using a section variable, add DynamicVariables=1 to the string measure.
https://docs.rainmeter.net/manual/variables/#DynamicVariables

Code: Select all

[mSetIcon]
Measure=String
String=[mHeading]
DynamicVariables=1
-Brian
spd2last
Posts: 2
Joined: March 23rd, 2021, 4:37 am

Re: String Measure failing to retrieve value from Registry Measure

Post by spd2last »

... yep. Embarrassed to have missed something so simple even though I have several other blocks with DynamicVariables. It just escaped me as the original mSetIcon didn't require it before. Thanks for that.