Windows Vista and Windows 7 - Create Registry Keys

Started by Andy Flowers, January 12, 2010, 02:42:13 PM

Previous topic - Next topic

Andy Flowers

I have a program that stores data in the Registry - HKEY_LOCAL_MACHINE/SOFTWARE/....... on an XP machine. However when my client upgraded his machine to Windows 7 we noticed that the data is no longer saved.

Has anyone encountered this problem or know what might be the problem? Any way to resolve this?

Andy Flowers

Ivan Iraola

LOCAL_MACHINE needs Admin rights, Win7 might be preventing it.
Android App Developer
http://www.uncledroid.com

David Kenny

Andy,

Ivan is right.  Windows 7 requires admin rights to write to the HKEY_LOCAL by default.

You can get around it several ways:
They can run your app using 'Run As' - Not very practical.
Your setup can change the rights on the keys they need to write to.  - Would work, but your app is already installed.
They can use regedit (logged in as Administrator) and change the rights. - Might be the best solution in this case.
You can modify your program to use the HKEY_CURRENT_USER/SOFTWARE/... - Won't be shared by all users.

You will have to decide what is best in your situation.

I did give you the short version.... feel free to ask for clarification if you need it.

David

Roger Garstang

If 64bit you may also need to look in the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node branch...depends on what you mean by not saving though since it should route your program to there for you and be transparent from your app's point of view.

Andy Flowers