.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Create registry keys on X64 registry during X86 app installation.

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

My applications is built with X86 target platform.

I’m creating the registry keys in HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon for auto-login to windows during my app installation. For this I’m executing a .reg file.

This process works in any X86 machines normally.

When I install this in X64 machine, all my registry keys were created under WOW6432Node (HKLM\Software\WOW6432Node\Microsoft\Windows NT\ CurrentVersion \WinLogon). Due to this issue auto-login not happening upon machine reboots.

How to create the registry keys under HKLM\Software\Microsoft\Windows NT\ CurrentVersion \WinLogon during installation?

Thanks in advance.


View Complete Post

More Related Resource Links

SQL 2008 Installation problem (Could not fix registry key)

Hello, I want to install SQL 2008 client tools on a Win 2008 machine. The machine already contains an instance of SQL 2005 Express which I don't want to unistall. The problem is that the installation wizard complains about Consistency Validation for SQL registry keys. The log shows the following: 2010-08-26 10:14:46 Slp: Could not fix registry key HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Client\ConnectTo. 2010-08-26 10:14:46 Slp: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto. 2010-08-26 10:14:46 Slp:    en Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.ContainsInheritedAce(Byte[] securityDescriptor) 2010-08-26 10:14:46 Slp:    en Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.FixRegistryKey(String keyName) 2010-08-26 10:14:46 Slp:    en Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.FixRegistryKeyAndSubKeys(RegistryKey key) I have created the "ConnecTo" key, which didn't even exist. I have also tried to set premissions to HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer to "Everyone/Full Control" but the installation fails over and over. Is there anything else I could try to get the SQL tools installed? Thanks in advance.

What registry keys are responsible for file extension association?

I'm trying to associate file extension to start some type of files with my application. Which registry keys I have to modify to be sure, that when user double click at file it opens with my application. And how get delete/modify permisions to key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\<extension>\UserChoice"? This key created after setting default program by "Open with" dialog. I've tried: string ext=".eee"; RegistryKey r = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\"+ext); RegistryPermission f = new RegistryPermission(RegistryPermissionAccess.Write, r.Name); f.Assert(); r.OpenSubKey("UserChoice", true); //at this step "Requested registry access is not allowed." exception occured

How to use (add, read, change, delete) registry keys with vb.net

Find this tutorial on Dot Net SourceReason of this project:This is the next part of the previous tutorial. We'll learn here how to add, change, read, delete registry keys and values using vb.net.I included a sample that contains all those functionality.Project details:1- How to add a registry key/value2- How to read a registry value3- How to delete a key or a value4- Changing a value or a key5- Hints to use registry with VB.net6- The registry reader (VB.net)1- How to add a registry key/valueOne thing that I think I forget to notice. A folder in the registry is name "key" and the elements in this key are named "values".There's a description of each value type in the 5th tutorialNow we'll see how to add a key or a value.Probably you have thought where we'll put it and whether it's a key or a value.So we have 2 things to notice.Visual Basic will automatically show you the hives (they are stored in).You'll have only to choose the needed one.To do that paste the following line. My.Computer.Registry.CurrentUser.CreateSubKey("TestKey")This line will create a key in the HKEY_CURRENT_USER hive and will be named "testkey"Now let's move on to see how to set a value.For the value we'll need three things: Value path, Value name and value value. We can also precise the value type if not Visual Basic will try to assign the value type depending o

Consistency validation for SQL Server registry keys


I cannot get past this support rule when I attempt to install SQL Server 2008 RC0.  When I attempt to drill into the failure the popup states "The SQL Server registry keys from a prior installation cannot be modified.  To continue, see SQL Server Setup documentation about how to fix registry keys."


First off, why would the SQL Server 2008 RC0 install attempt to modify registry keys from a prior installation if I am attempting to install it side-by-side with a prior install of SQL Server 2005 Developer Edition?  


Second, can anyone point me to the SQL Server Setup documentation that walks me through how to go about fixing these registry keys?


Any help would be greatly appreciated.  Thanks in advance for your help.


Wendell G


Issue reading x64 Registry keys


I have a C# console app compiled with .Net 2.0 in 32 bit machine. This app run fine in 32bit machine. But when I run in x64 machine I get some issues.

I figured out that the information about app was installed correctly on HKLM\SOFTWARE\Wow6432Node\MyCompany\MyApp\ registry key.

But in my code I have hard coded the following string "SOFTWARE\MyCompany\MyApp"

I thought that WOW64 could translate correctly from "SOFTWARE\MyCompany\MyApp" to SOFTWARE\Wow6432Node\MyCompany\MyApp. I am using the class RegistryKey from the Framework. I know that all is correct because it works in 32bit but seems that I am missing something with x64. I got a look at Registry Redirection and Reflection but could not see a solution. Any idea?





Bug? Writing to 64/32 bit Registry Keys


I had been searching for a way to write to the 64 and 32bit (WOW6432Node) registry keys becuase it's hard to predict where external processes I'm working with will be reading from.

.net 4 has a great new way of pointing explicitly to the keys with the RegistryKey.OpenBaseKey method.  It works fine until I point at:


RegistryKey RegCUBase32 = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);


This should (In my mind) Push me to the HKCU\Software\WOW6432Node when I try to write to the HKCU\Software  (that's how things work in HKLM)
-but it does not

See the following code:


using System;
using Microsoft.Win32;

  public static void test()
   String regPath = "SOFTWARE\\Test"; ;
   RegistryKey TestKey;

   //works fine:
   RegistryKey RegLMBase64 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
   TestKey = RegLMBase64.CreateSubKey(regPath);

Access Control: Understanding Windows File And Registry Permissions


Understanding the ACLs that govern permissions and rights before an operation is allowed to proceed is critical to enhancing security.

John R. Michener

MSDN Magazine November 2008

Windows 2000 Registry: Latest Features and APIs Provide the Power to Customize and Extend Your Apps


The Windows registry as it is recognized today first appeared in Windows 95. Its introduction simplified the storage of initialization information and made that data more secure. This article covers the history of the registry, the form it took in the early days, and its current incarnation in Windows 2000. Practical tips for managing data in the registry are outlined, along with descriptions of special keys, functions, and file types. Manipulation of the registry to customize both application behavior and certain features in Windows is discussed. Also covered are future directions of the registry, including the use of XML to store registry information in a hierarchical fashion.

Dino Esposito

MSDN Magazine November 2000

My registry shell extensions to TXT not adding

I have just passed from WinXP 32 bit VisualBasic 2005 standard to Win7 64 bit  VisualBasicExpress 2010 . I declare in the registry a new extension named GSI and assign my own shell commands. I test it right clicking a file with a GSI extension in windows explorer and the expected shell options appear . Everything OK . Then i try to add some shell extensions of my own for TXT extensioned files . In WinXP everything works fine . In Win 7 none of my options appear . Any ideas ?

Windows 7 64bit Registry access using x86 assembly

Hi guys, I have an assembly that is complied in x86 release mode. The assembly tries to access  a particular registry key in Win7 the key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion  -> ProductID(tried to read this value) As the assembly is in x86 it tries to look for the key in SysWow64 node HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion -> ProductID(tried to read this value) When i went through the registry i found that the string "ProductID" is missing (!) .. (may be because i have trial version of windows 7 x64)? I just wanted to ask , is there a way to read registry key (not in wow6432node ) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion  -> ProductID  in x86 mode? Im using the following  code RegistryKey regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", false); //reads in wow6432Node for x86 assembly string strProductID = string.empty; if (((regkey != null))) { // Get key Value of ProductId. strProductID = (string)regkey.GetValue("ProductId"); if ((string.IsNullOrEmpty(strProductID))) { //try reading another path for "ProductID" } } return strProductID ; PS:When i complie the same assembly as "Any Cpu" , the above code returns corr

SQL2008 Standard setup failed. The performance counter registry hive is corrupted.

OS: Windows7 Ultimate 64bit (Traditional Chinese HKSAR) SQL: SQL Sever2008 RC2 Standard English (either x86 or x64) I have searched for answers on the web, tried all of them and still cannot get pass. 1. manually rebuild Performance Counter Library values as suggested in http://support.microsoft.com/kb/300956/en-us 2. string test = string.Format ("{0,3}", CultureInfo.InstalledUICulture.Parent.LCID.ToString ("X")).Replace (" ", "0"); which shows "31748" for me, added it under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib (with values from 009) 3. C:\windows\systrem32\lodctr /r to rebuild counters.   The error just won't go. Actually, I just want to use the management studio to connect to SQL Server2008.. Is there a way to install only the management studio? I am willing to give up installing SQL Server2008 on my Windows7.   Thanks in advance.

Prompt "The proper type library could not be found in the system registry" when open SQL2008 Express

Hi folks, I just format my notebook and installed the Win7Pro Eng 32-bit version and then install the SQL2008Express. I restarted my notebook as usual after the installation and open the SQL SMS, it prompt the following error "The proper type library could not be found in the system registry", It's a big dialog with certain text saying I do not have permission...etc. Since, I am using administrator account to open the program already but still fail. I have to repaire the SQL SMS too. May I know any other I can check? Any comment is highly appreciated. Thank you very much! Regards, Tony  

Registry OpenSubKey returns null

Hi,It seemed to be the right place to post to.My problem is that when I try to read registry key, I get null value, even if it exists (regedit shows it exists).Application is windows service with Log On As Local System and registry key im trying to read is in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSIDOn my development machine (x64 win7) it works fine. But in live server (x64 windows server 2008 r2) I get NULL. These operating systems should have similar policies or does Local System on server 2008 have any restrictions i should know about?RegardsMax

The performance counter registry hive is corrupted on Windows 2008 R2 Foundation 64Bits

Hello, I know we have a few posts about this but not exactly about this windows version. I tried: http://support.microsoft.com/kb/300956 But nothing!... :( Could someone help me? Thanks, Renato

How to resolve "Performance counter registry hive consistency check" failed?

I want to install SQL Server 2008 November CTP Developer Enu. When "System Configuration Check" it shows: Rule "Performance counter registry hive consistency check" failed. The performance counter registry hive is corrupted.   And cannot continue installing. How to solve this problem?

Service Registry, UDDI, WS-Discovery ... slippery slope ?

Hi, i work for a retail company, we are starting to make some internal software in. NET and of course using WCF to 'connect' applications, we have still a very long way to a SOA architecture but i am doing some deep researching on the path to SOA.   One thing i dont see a good solution is in how to implement some service registry, for human and software access, at this point of my research im not looking for a ESB or some robust and powerfull (and complex) middleware for services architecture, currently i want to publish services with associated documents for human acess and of course for client access, my initial requirement would be given a contract (Interface) determine a service endpoint based on parameters such as network response, debug/production, service quality, transaction support, etc. with this i start looking and of course first go to see UDDI, i use for research Windows Server 2003 and Windows Server 2008 and both gives me UDDI as a component of the OS, so i was happy to there, but i start read some microsoft documentation i began to doubt, the docs are poor for msdn standar, refers some requirements in terms of Netscape navigator... supports API v2.0 of UDDI and frm 2005 there is v3....   plus trying to use the UDDI wasnt very easy for an IT manager people, i have some gap between WCF services and the UDDI model, not easy to close... doing some more research i
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend