Registry problem with 64-bit Vista
-
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.
-
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.
Hi, looks like the installer works on 32-bit environment (Wow6432Node, this is absolutly transparent for the installer). The application works on 64-bit and looks up the key like on a 32-bit mashine without Wow6432Node. is there a way to compile a installer for 64-bit sys? I'm not adept in installers. ;-) bye