Open drocta opened 2 years ago
Thanks for documenting this, it's what I needed to get brotab running. I can confirm even running with admin rights does not get those reg entries set.
Thank you for confirming that, and I'm glad documenting it helped!
I decided to search again for the reason why winreg saw the changes that should have been made to the registry, while I didn't see them in regedit (until I put them there myself).
I encountered this stack overflow answer about someone having a similar issue with the winreg module : https://stackoverflow.com/a/73452030/6395463 , and the answer there said that they found that this issue occurs for them because they were using the version of python that comes through the windows store, which, for some reason, redirects what one does with winreg to some other location (I guess maybe some like, registry that is only used by windows store apps or something? not sure.)
And, the version of python I installed, regrettably, is the version that comes from the windows store.
@AJolly , is the version of python you have installed, also the one that came through the windows store?
If so, then I think we've found our culprit!
Edit: I believe it would be good to have brotab check whether 'WindowsApps' in sys.executable
(or platform.sys.executable
)when it is trying to set up the registry stuff, and if that conditions returns true, then warn the user that the registry settings might not have been set correctly.
I'm not 100% sure, but I would have intentionally installed Python from the windows store.
Perhaps the easiest workaround would be to have it generate the registry files, and have to use your manually run those.
Or shell execute a reg add
The documentation also wasn't quite clear I didn't realize I needed to do BT install.
I am running windows 11. The user I am logged in as is not an admin. I am not sure if this is related. By manually modifying my registry, I was able to get it to work. What follows is the steps I took. When I ran brotab install, it said
I had the firefox browser extension installed, and restarted firefox. running
bt clients
did not output anything (except an empty line) before finishing.I looked at the extension debug tools (in about:debugging) and saw that the extension logged that the connection had been closed. I also noted that the code lisening for disconnects did not manage to find the error message. The code
gave me only "lastError is undefined". (aside : I'm not especially familiar with js stuff. Is that variable
chrome
there specific to the browser called "chrome", and that's why thechrome.runtime.lastError
is null for me, or is that variable present regardless of which browser? I'm guessing the latter?) Looking at the objectport
returned by theruntime.connectNative
call, I found that it had an error field saying that the application didn't exist (sorry, I no longer have the exact error message available, didn't think to document this until after I got it working) I found https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_manifests#manifest_location and tried to find whether any of those registry keys had been set. In regedit, I did not find any of them, neither inHKEY_CURRENT_USER
nor inHKEY_LOCAL_MACHINE
Creating a registry entryComputer\HKEY_CURRENT_USER\Software\Mozilla\NativeMessagingHosts\brotab_mediator
with the content (in my case)C:\Users\madaco\.mozilla\native-messaging-hosts\brotab_mediator.json
(which is whatbt install
claimed to set it to, and where I had previously confirmed that the file referred to there exists), seems to have solved the problem.suggested changes to make this easier to debug in the future:
brotab install
is unable to set the proper registry, it would be good if it would say so. Initially I thought that it had just set one in the wrong place, but I could not find any of the registry entries it claimed to create. Or, I have not tracked down the reason why the registry entry was not created, so maybe the problem isn't that it couldn't create it?Side note : It also did not work in chrome when installing the extension on chrome, though I have not tested the registry entry fix on chrome.
Sorry if I'm being presumptuous. Part of this is just that I want what problem I had + the solution, documented, in case others have the same issue.
Edit: I tried looking at the values the python module winreg gives when trying to access those values, and it sees the values as being set. This to me seems very strange, because they do not appear when using regedit. I have no explanation for this.