Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

We have an application that originated on Windows XP. We are finding problems reported by users that are caused by both folder and registry virtualisation on Windows 7. I am trying to re-jig things so that it works "with" Windows 7, rather than working "around" it, so to speak. I need to save a registry setting *somewhere*, but I'm no longer sure where it ought to go. I read the MS page on registry virtualisation, and whilst I understand how it works, it doesn't really help me on what I ought to do instead.

As far as I understand, I need to avoid using HKLM at all, so would it be ok to create a new key underneath HKEY_USERS? If I did, would it end up being virtualised?

Thanks in advance for any help.
Posted

1 solution

Hi,

You can just write HKEY_LOCAL_USER without Admin priviligies. If you want to share with all users you should have admin priviligies or you can create a folder all user can reach and in this folder you can create an ini file. All users have their own HKEY_LOCAL_USER so all users' HKEY_LOCAL_USER are different. You must avoid HKLM, if your program may not have admin rights. If users who can have admin rights you can use HKLM or as I said before you can create an ini file.
 
Share this answer
 
Comments
MaluCachu 30-May-13 4:44am    
Hi,

Thanks for the response, I appreciate it. Just to give you more information, what I'm looking to store in the registry is actually the path for, amongst other things, an INI file. The registry setting will actually be made during an install, so the user would, at that point, have full access. During normal running of the program however, we would expect the user to have only read access, which is fine as they would only be reading the key, but we want all users to access the same registry key, rather than one per user. Given this, do you think we should still use HKLM? The things I have read whilst investigating this all seem to imply that I should avoid it at all costs...

Thanks again for your help

Keith
Osman24 30-May-13 4:55am    
Hi,

Here is the thing. You should use HKLM because you want access for all users. If application will not write anything. you can read from hklm without admin rights and the good point is that as I know, by using trusted installers setup do not need admin rights to write to hklm. I'm using it now but I did not check it for all kind of users. I'm using Inno setup and also setup project also will be ok.

Another thing is HKLM keeps lots of com data and operating system data. you must select a path in hklm which is not used before to avoid to break any other data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900