[SOLVED] Error from native messaging app: "Win error 5 during operation open on file C:\Users\...\native-msg-demo (Access is denied.)

I’m trying to run the native messaging demo (as given in this MDN article on WebExtension native messaging) on a Windows 7 machine. I have Python 3.6.6 installed on that system and have copied the demo app files (the app manifest, the Python script and the batch file that runs the Python script) to C:\Users\username\Documents\native-msg-demo. I’ve added the Windows registry keys (HKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\ping_pong) and set its value to the path to the location of the app manifest. The app manifest’s “path” property points to the .bat file.

But after I install the native messaging WebExtension in Firefox, I see the following error in the browser console:

Win error 5 during operation open on file C:\Users\username\Documents\native-msg-demo (Access is denied.)

I’ve already checked the “native-msg-demo” folder and confirmed that I have permissions to it. What else am I missing in my setup? Thanks in advance for any advice.

Problem solved after reading this GitHub issue from the native messaging demo repo. The cause of the error was that the path to the app manifest in the Registry key was incomplete; adding the file name of the app manifest file at the end of the path solved the problem.