I have a dll when its software gets installed, it gets installed in
HKEY_LOCAL_MACHINE\\SOFTWARE for 32-bit OS and
HKEY_CURRENT_USER\\SOFTWARE for 64-bit OS.
How do i detect the dll path based on the registry key ?
I don’t want to hard code like this.
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Software//NodeName")
I can try detecting 32-bit or 64-bit OS and do something like
If 32-bit
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Software//NodeName")
If 64-bit
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software//NodeName")
But is there a way i can detect the path of the dll directly if for example the dll name is specified and how do i do an entire registry check and find its path name?
HKEY_CLASSES_ROOT\CLSID contains the list of all registered COM files (.ocx,.dll, .ax) on the system no matters if is 32 or 64 bits.
The key under CLSID is represented by the generated GUID of each COM.
And finaly into the GUID key, there is the InprocServer32 sub-key, in it, the default value contains the path of the COM file into the sistem so you can find it as follows:
VB CODE:
C# CODE: