PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Andy Flowers on January 12, 2010, 02:42:13 PM

Title: Windows Vista and Windows 7 - Create Registry Keys
Post by: Andy Flowers on January 12, 2010, 02:42:13 PM
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
Title: Re: Windows Vista and Windows 7 - Create Registry Keys
Post by: Ivan Iraola on January 12, 2010, 03:08:16 PM
LOCAL_MACHINE needs Admin rights, Win7 might be preventing it.
Title: Re: Windows Vista and Windows 7 - Create Registry Keys
Post by: David Kenny on January 12, 2010, 03:53:44 PM
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
Title: Re: Windows Vista and Windows 7 - Create Registry Keys
Post by: Roger Garstang on January 12, 2010, 05:11:09 PM
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.
Title: Re: Windows Vista and Windows 7 - Create Registry Keys
Post by: Andy Flowers on January 12, 2010, 09:15:30 PM
Thanks for your suggestions.