Extensions and windows registry entry

I have an extension that is used to launch a native application. (BTW I am using version 50 beta which has nativeMessaging functionality). The native application can be installed by the end user in which case the extension registry entry is written to HKEY_CURRENT_USER\Software\Mozilla\NativeMessagingHosts. The native application can also be installed by an administrator which is different from the end user in which case the extension registry entry is written to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\NativeMessagingHosts. In the administrator install case, the extension is still looking at HKEY_CURRENT_USER\Software\Mozilla\NativeMessagingHosts. Is this by design? In other words, should I be creating the registry key under HKEY_CURRENT_USER in all cases?

Perhaps the issue is that the key is under Wow6432Node?

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging#Windows:

Note that this key should not be created under Wow6432Node,
even if the app is 32-bit. The browser will always look for the key
under the “native” view of the registry, not the 32-bit emulation.

The C++ RegCreateKeyEx command adds the WoW6432Node. So the result was:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\NativeMessagingHosts\myExtension

I manually added:

HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\myExtension

which still didn’t work. I then added:

HKEY_CURRENT_USER\Software\Mozilla\NativeMessagingHosts\myExtension

and it worked.