MikaelH Posted April 6, 2011 Report Share Posted April 6, 2011 Hi Guys This is not really a LabVIEW problem, but more a Windows 7/ LabVIEW's Registry Writing VIs. My LabVIEW application updates the Registry, to link a File-Extension to a exe-file. I do this by adding some keys under the: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ It works in XP, but now with Vista and Win7, I get permission denied from the Registry VIs. Err=-604,Remote registry access denied Does anybody know how to solve this? Ilike my LV applications to check if it has been modified when it starts andupdate it if needed. Different LV applications should be able to relink the same file-extension to different targetexe-files. I can manually change the permission in the registry but I don't want all users to need to do that. Cheers, Mike Quote Link to comment
Onno Posted April 6, 2011 Report Share Posted April 6, 2011 It sounds like your LV application is not running with Administrator permissions. Since Windows Vista, access to certain disk folders, as well as a few registry keys (including HKEY_LOCAL_MACHINE), has been restricted to improve security. If your LV application is compiled into an EXE, try right-clicking on the EXE file in Explorer and selecting "Run as Administrator". Otherwise, I think you'll have to do that with LabVIEW itself, and run your application in this copy of LabVIEW runnign with Administrator permissions. I hope this helps! (See also Wikipedia's "User Account Control" topic) Quote Link to comment
hooovahh Posted April 6, 2011 Report Share Posted April 6, 2011 I recently found out that LabVIEW can read the registry without needing higher privileges. When you do your first Registry Open there is a method enum which by default is Write and Read. If you only need to read set it to Read and you won't get permission errors. But yeah since you will likely need to write the registry you will need to run the program with higher privileges. 1 Quote Link to comment
Mads Posted April 6, 2011 Report Share Posted April 6, 2011 As others already say here your app needs admin access. I normally add the file association from the installer instead as it will always have the necessary access anyway. Quote Link to comment
gleichman Posted April 6, 2011 Report Share Posted April 6, 2011 Can you set it for the "Current User"? When I updated my applications for Win7, I moved my registry setting from "Local Machine" to "Current User" to fix permission problems. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Extensions Quote Link to comment
Tim_S Posted April 6, 2011 Report Share Posted April 6, 2011 Does anybody know how to solve this? Ilike my LV applications to check if it has been modified when it starts andupdate it if needed. You can turn off the UAC and that should allow you to write, but then you're running without the UAC. There is a meathod to request enhanced permissions (not sure if that's the actual name for it) which allows you to temporarily modify the registry, files in Program Files, etc. I'm not sure what's involved, but that's where I got to when I decided it would be easier (and save some of what little sanity I have) to put a flag in the code to switch where values were stored based on XP or Win7. Tim Quote Link to comment
MikaelH Posted April 6, 2011 Author Report Share Posted April 6, 2011 Thanks for the feedback guys I followed your examples: Can you set it for the "Current User"? When I updated my applications for Win7, I moved my registry setting from "Local Machine" to "Current User" to fix permission problems. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Extensions and used HKEY_CURRENT_USER\SOFTWARE\Classes\ And now it works again :-) Cheers, Mikae Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.