المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Registry problem with 64-bit Vista



C# Programming
10-01-2009, 04:11 AM
Hi All,

I have created one Windows Applcation and its Setup. While installing the appliaton with Setup.exe, I create one registry entry with below code.

Step 1 : regKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\MyKey");
Immediately after this, I read this value with below code.

Step 2 : regRead = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MyKey", true);
Then when I run the application I read the registry with below code, it is same as Step 2.

Step 2 : regRead = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MyKey", true);
All works fine..

But when I installed this application on 64-bit Vista Business machine it creates problem.

Vista created Wow6432Node for registry entries of 32-bit application. It is a transparent process.

For, Step 1 it has created MyKey under HKLM\SOFTWARE\Wow6432Node\Microsoft.
For, Step 2 it has fetched value of MyKey from HKLM\SOFTWARE\Wow6432Node\Microsoft.
For, Step 3 it does not find the registry entry and return null.

Code for opening sub key in Step 2 and 3 is same..

Please advise.

Regards,
-SIFAR.