64 bit & 32 bit Registry issue in Windows (Programming in c#) -


i'm trying data registry of windows software there 1 thing i'm having trouble it:

if software runs on 64 bit system registry path :

hkey_local_machine\software\wow6432node\avast software\avast programfolder 

and if software runs on 32 bit system registry path :

hkey_local_machine\software\avast software\avast  programfolder 

what can ? double check every time ?

maybe check second option(without \wow6432node\) , when software runs on 64 bit automatically add path \wow6432node\ ?

what best solution issue ?

before further, should have read of documentation of registry redirector. it's important have clear understanding of does.

ok, understand registry redirector, let's @ how tackle problem. have few options. simplest build program target x86, , access hkey_local_machine\software\avast software\avast programfolder no matter bitness system run on. way code run in 32 bit process , see 32 bit view of registry. registry redirector handle mapping onto true physical wow6432node transparently.

alternatively, if must use anycpu, , must cater running inside 64 bit process, need use registryview enumeration. allows read 32 bit view of registry, 64 bit process. again access hkey_local_machine\software\avast software\avast programfolder ask key respect 32 bit view of registry.


the golden rule registry redirector must not hard code wow6432node paths. documentation says this:

redirected keys mapped physical locations under wow6432node. example, hkey_local_machine\software redirected hkey_local_machine\software\wow6432node. however, physical location of redirected keys should considered reserved system. applications should not access key's physical location directly, because location may change.

don't tempted break rule. system provides mechanisms read 32 bit view in supported manner.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -