Registry Redirection for 32-bit applications on 64-bit OS

Well, this title looks complicated...actually the story is pretty simple by using an example.

For example, you write an application APP_A and the installer of this application needs to leave fingerprint on system's registry keys, so that the other applications/users can know APP_A is installed on the system. Assuming that "fingerprint" is "HKLM\Software\Microsoft\App_A", and you selected the target platform as "Any CPU" when you build it, it looks like that you are done. However, if your APP_A is installed on 64-bit OS, the other 32-bit application will complain that it can not detect APP_A.

Why? Simply because registry REDIRECTION. Because here HKEY_LOCAL_MACHINE\Software is redirected to HKEY_LOCAL_MACHINE\Software\Wow6432Node.[However, please note that HKEY_CURRENT_USER has no redirection here].

Therefore, if your application wants to support the access of those 32-bit applications/processes on 64-bit OS, you need to leave fingerprints on both WoW6432Node and regular node of HKLM registry key. About registry redirection, more information is at https://msdn.microsoft.com/en-us/library/aa384232(VS.85).aspx

[PS: how do you know the application is 32-bit or 64-bit? Use "dumpbin", a command line tool. for example, on 64-bit OS, %windir%\syswow64\cmd.exe is a 32-bit command shell and %windir%\system32\cmd.exe is the 64-bit command shell (the default one on the start menu)]