It is currently March 29th, 2024, 8:13 am

How to display HWiNFO data (v7+) in non-admin account?

Get help with installing and using Rainmeter.
Paddles
Posts: 2
Joined: October 9th, 2021, 10:45 am

How to display HWiNFO data (v7+) in non-admin account?

Post by Paddles »

Hi. Is it possible to use Rainmeter with info collected from HWiNFO (v7+) in a non-admin account? I can get it to work properly with an admin account, but not when logged in with a non-admin account, even when Rainmeter and HwInfo are both launched elevated.

I'm using raiguard's ModernGadgets, v1.8.1. Testing this out on an older machine (my main computer is staying on HWiNFO v6 until I can sort this out):

Rainmeter 4.5.4.3550 (64-bit)
Language: English (1033)
Build time: 2021-10-04 9:25:19
Windows 10 Pro 2009 64-bit (build 19043) - English (2057)
Path: C:\Program Files\Rainmeter\
SkinPath: C:\Users\redacted\Documents\Rainmeter\Skins\
SettingsPath: C:\Users\redacted\AppData\Roaming\Rainmeter\
IniFile: C:\Users\redacted\AppData\Roaming\Rainmeter\Rainmeter.ini

and HWiNFO64 v7.12-4580. I've used raimeter's configuration instructions (and I've also seen SilverAzide's similar instructions).

With this combination, when I was logged in with an admin account, I could configure everything and see information from HWiNFO displayed -see the temperatures, fan speeds, voltages on raiguard's CPU Meter for example:
Admin account - CPU gadget.png
raiguard's settings for doing the HwInfo config worked exactly as expected:
Admin account - HwInfo sensor config.png
But when I log in to a non-admin account on the same machine, even when Rainmeter and HWiNFO are both running elevated, the CPU meter doesn't show the same information; temperature/fan/voltages are missing:
Non-admin account - CPU gadget.png
If I try to follow the same instructions, I get an error message that HwInfo isn't running/configured, even though it is:
Non-admin account - HwInfo sensor list message.png
Yet we can see that HWiNFO 7 is running, the Sensors window is open, and the HWiNFO Gadget settings are set appropriately (having matched the numbers manually from the HWiNFO gadget - they were the same for both accounts).
Non-admin account - HwInfo sensor config.png
and the settings are still correct
Non-admin account - HwInfo settings.png
Can anyone see anything I've missed? Is there any way to make this work?

(I had the same issue first on my primary machine when I tried updating HWiNFO and ModernGadgets to the latest versions. I've reverted to HWiNFO 6.42 and ModernGadgets 1.7.0.)

As an experiment, I tried switching on HWiNFO's Shared Memory Support, hoping it would make a difference, but it didn't.

Thanks in advance
You do not have the required permissions to view the files attached to this post.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by SilverAzide »

Paddles wrote: October 9th, 2021, 12:34 pm Hi. Is it possible to use Rainmeter with info collected from HWiNFO (v7+) in a non-admin account? I can get it to work properly with an admin account, but not when logged in with a non-admin account, even when Rainmeter and HwInfo are both launched elevated.
You should be able to use a non-admin account. It looks like you've done everything exactly correct. You do not need to run Rainmeter with elevated privileges, but HWiNFO will need it as usual (all utilities that directly access hardware need it).

The key difference between HWiNFO 7.x and older versions, is that ModernGadgets 1.8.x (and Gadgets 6.x and later) does NOT use the Shared Memory feature of HWiNFO. Instead, HWiNFO 7.x has a alternative feature where the sensor data is written into the Windows registry, and the skins then read the registry to get the data. This allows skins to get around the issue of needing the Pro version of HWiNFO.

From your description of the issue, it seems like your non-admin accounts are unable to read the HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB key. This seems odd, since the HKEY_CU hive should be the only one you DO have full read/write access to when using a non-admin account.

With HWiNFO running and using your non-admin account, run the following command at a command prompt or PowerShell prompt (NOT elevated):

Code: Select all

reg query HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB
You should get a ugly looking dump of registry entries showing sensor data. (This is the same list that you see when you click the Setting skin option to list your indexes, but without the formatting.)

However, if instead you get an error message, please post that here so we can take a look.
Gadgets Wiki GitHub More Gadgets...
Paddles
Posts: 2
Joined: October 9th, 2021, 10:45 am

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by Paddles »

(TLDR version: Rainmeter elevated is working now. Not sure how non-elevated would work as they'd be different HKCU folders.)
SilverAzide wrote: October 9th, 2021, 3:03 pm From your description of the issue, it seems like your non-admin accounts are unable to read the HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB key. This seems odd, since the HKEY_CU hive should be the only one you DO have full read/write access to when using a non-admin account.
Thanks, you're right and I wish I'd thought of checking that. With a non-elevated command prompt, I get the error message:
ERROR: The system was unable to find the specified registry key or value.

But with an elevated command prompt, the results appear as expected.
Reg query results.png
Thinking about it further, the HKCU hives for the elevated and non-elevated command prompts would be aliasing different folders in HKEY_USERS - so the unelevated user would be looking at HKEY_USERS\<one profile string>\SOFTWARE\HWiNFO64, but HWiNFO is writing data into HKEY_USERS\<different profile string>\SOFTWARE\HWiNFO64. (As a test, I tried "reg query HKCU\Environment" in both windows, and got different results including references to different user folders under C:\Users\ ... which leaves me mystified as to how a non-admin user could ever get info.

I tried this morning, running Rainmeter elevated - and this time the data that HWiNFO would provide was showing up. I'm guessing that maybe yesterday I was mistaken when I thought I was running Rainmeter elevated in the non-admin account. (Seems more likely than having forgotten to refresh skins, because I did that multiple times.) If I exit Rainmeter and then run it normally (not elevated), it no longer gets info from HWiNFO.

That at least gives me a solution - running Rainmeter elevated. It'd be good if there was a way to do it without Rainmeter elevated and I'd be happy to test ideas.
You do not have the required permissions to view the files attached to this post.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by SilverAzide »

Paddles wrote: October 9th, 2021, 11:57 pm Thinking about it further, the HKCU hives for the elevated and non-elevated command prompts would be aliasing different folders in HKEY_USERS - so the unelevated user would be looking at HKEY_USERS\<one profile string>\SOFTWARE\HWiNFO64, but HWiNFO is writing data into HKEY_USERS\<different profile string>\SOFTWARE\HWiNFO64. (As a test, I tried "reg query HKCU\Environment" in both windows, and got different results including references to different user folders under C:\Users\ ... which leaves me mystified as to how a non-admin user could ever get info.

I tried this morning, running Rainmeter elevated - and this time the data that HWiNFO would provide was showing up. I'm guessing that maybe yesterday I was mistaken when I thought I was running Rainmeter elevated in the non-admin account. (Seems more likely than having forgotten to refresh skins, because I did that multiple times.) If I exit Rainmeter and then run it normally (not elevated), it no longer gets info from HWiNFO.

That at least gives me a solution - running Rainmeter elevated. It'd be good if there was a way to do it without Rainmeter elevated and I'd be happy to test ideas.
Oh yes, I get it now. Since you must elevate HWiNFO, then obviously you'll need to elevate Rainmeter as well so they are both running as the same user. Hmm, this is an unfortunate (and unforeseen) side-effect of using the registry instead of shared memory. You're right, a non-admin user will never be able to access the HKCU key where HWiNFO is storing the data...

So it seems like the answer to your question "How to display HWiNFO data (v7+) in non-admin account?" is one of the following:
  1. Run Rainmeter elevated, same as HWiNFO, or
  2. Use the HWiNFO v7+ Pro version and enable the shared memory option. (And since ModernGadgets 1.8+ and Gadgets 6.0+ don't use the shared memory feature, neither will work, so you'd need to downgrade these skins to the older versions.)
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by SilverAzide »

Paddles wrote: October 9th, 2021, 11:57 pm That at least gives me a solution - running Rainmeter elevated. It'd be good if there was a way to do it without Rainmeter elevated and I'd be happy to test ideas.
After a little more thinking, in my opinion this is actually a problem with HWiNFO, though the author may disagree. HWiNFO should be writing sensor data to HKEY_LOCAL_MACHINE, not HKEY_CURRENT_USER. If HKLM was used instead, none of this would be a problem, as all users have at least read access to HKLM. And since HWiNFO must be run elevated no matter what, it has write access to HKLM.

Martin (the HWiNFO author) is leveraging his old Windows Sidebar Gadget functionality to allow Rainmeter skins to function without needing shared memory. Perhaps in that scenario using HKCU was okay, and he's also using that same hive for storing user info too. I wouldn't expect him to alter HWiNFO for this, but one could ask him if so inclined.
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by SilverAzide »

Paddles wrote: October 9th, 2021, 11:57 pm That at least gives me a solution - running Rainmeter elevated. It'd be good if there was a way to do it without Rainmeter elevated and I'd be happy to test ideas.
https://www.hwinfo.com/forum/threads/registry-access.7631/

I suspect Martin will not be making any changes, as anything he does will break every skin that works with the new 7.x features. Your only option is to run both HWiNFO and Rainmeter elevated. You can create a batch file that you ran run elevated to launch both apps (thus only a single UAC dialog) or a self-elevating PowerShell script (i.e., prompts for elevation if needed).
Gadgets Wiki GitHub More Gadgets...
nikko
Posts: 44
Joined: December 5th, 2017, 5:58 pm

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by nikko »

how to run HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB in a skin with mouse?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by eclectic-tech »

nikko wrote: October 23rd, 2021, 4:22 pm how to run HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB in a skin with mouse?
Try looking at the demo skin at the bottom of this page: Using HWiNFO with Rainmeter

It also includes a 'ShowReg' skin that use a Lua script and the Run command to format and display those values in your browser.

You can activate that config using any mouse action:
LeftMouseUpAction=[!ActivateConfig "HWiNFO_New/ShowReg" "showreg.ini"]

You can display sensor values by creating measures in your skin for the desired sensor:

Sensor0Demo.ini

Code: Select all

[Measure0Sensor]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Sensor0

[Measure0Label]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label0

[Measure0ValueFormatted]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value0

[Measure0ValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw0

[MeterString]
Meter=String
MeasureName=Measure0Sensor
MeasureName2=Measure0Label
MeasureName3=Measure0ValueFormatted
MeasureName4=Measure0ValueRaw
Text=%1#CRLF#%2#CRLF#%3#CRLF#%4
SolidColor=200,200,200,217
Note: OFC, HWiNFO must be running to see any of this information.
nikko
Posts: 44
Joined: December 5th, 2017, 5:58 pm

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by nikko »

you misunderstood my wish. To clarify: I need to open Windows Registry Editor and that registry location with one click on Rainmeter skin. ActivateConfig is to open a config, but I am not sure what to use for this action.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to display HWiNFO data (v7+) in non-admin account?

Post by eclectic-tech »

nikko wrote: October 23rd, 2021, 5:38 pm you misunderstood my wish. To clarify: I need to open Windows Registry Editor and that registry location with one click on Rainmeter skin. ActivateConfig is to open a config, but I am not sure what to use for this action.
I don't think you can do it without using a separate utility like RegJump from Microsoft and using that in a RunCommand measure.
microsoft wrote:This little command-line applet takes a registry path and makes Regedit open to that path. It accepts root keys in standard (e.g. HKEY_LOCAL_MACHINE) and abbreviated form (e.g. HKLM).
EDIT: I just saw silverAzide's suggestion after posting this added info. I would recommend using the 'formatted' output that provides, but if you really want to open RegEdit at this key, here is how you can do it.

ADDENDUM
You can create a skin that will run the command to open Regedit at the defined key and then deactivate itself.
Use any mouse action to !Activate that skin; LeftMouseUpAction=[!ActivateConfig "{yourskinConfigName}" "HWiNFORegEdit.ini"]

Notes:
Rainmeter must be running at Administrator level to be able to use regjump.exe.
The executable (regjump.exe) needs to be in the same folder as this demo skin 'HWiNFORegEdit.ini'.

HWiNFORegEdit.ini

Code: Select all

; You must run Rainmeter with Admin privileges for 'RegJump' to work
[Rainmeter]
Update=-1
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure MeasureQuery "Run"]

[Variables]

[MeasureQuery]
Measure=Plugin
Plugin=RunCommand
Parameter=""regjump.exe HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB""
OutputType=ANSI
FinishAction=[!DeactivateConfig]

[MeterDummy]
Meter=String