Registry Variables Don't Work On Windows 8?


gkimsey

Recommended Posts

See the attached test project. By running the RegistryWrite sequence and then the RegistryRead sequence, "Registry Test" should appear in the Alert window. Works for me on Windows 7 but not on Windows 8. I'm running as administrator on both.

Can you guys replicate this?

regtest.ctl

Link to comment
Share on other sites

Okay, found the problem. Short answer: You were right, permissions issue.

Background for the next person who runs into this:

I discovered that DAQFactory was writing the registry variables to a virtualized registry location, but Windows apparently wasn't redirecting it there for the subsequent "read" (because it failed to read it back). Turns out it was doing this because I didn't properly install DAQFactory as an administrator.

This is one of those Windows Vista-and-later gotchas related to User Account Control (UAC). Even if you're an admin, if you don't right-click and use "Run as Administrator" AND you still have UAC enabled, you're not "really" running as an administrator. This results in DAQFactory.exe being installed with reduced permissions, which subsequently means it doesn't access the registry the same way.

So the solution is easy: Reinstall with admin privileges.

Two suggestions for DAQFactory updates:

1) This can't be an unusual problem. I didn't have the issue on my Windows 7 machine because I had UAC turned off before I installed DAQFactory, but this probably can't be relied upon. Maybe the installer can verify full admin permissions before allowing the install to go forward. It does say "must be installed by an administrator," but that was technically true when I encountered the problem.

2) In order for the "virtualized registry" to have worked for writing the registry entry but NOT for reading it, it seems like there may be some discrepancy between them internally. Maybe some older/newer APIs being mixed or something.

Link to comment
Share on other sites

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.