-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detecting os and windows path #25
base: master
Are you sure you want to change the base?
Conversation
Hi @andersoncarlosfs I just had a look at your code and I'm wondering if this approach has any advantages over the much simpler way of querying the windows registry? This code gives the complete version string at least on my system and even does not require the exact location of the Chrome installation: import winreg
with winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER, r"Software\Google\Chrome\BLBeacon") as key:
version = winreg.QueryValueEx(key, "version")[0] With the check for Windows/Cygwin you added and your refactored |
Hi @andersoncarlosfs , any update on this? |
Hello @danielkaiser, Well, I was testing your suggestion and I found that it does not work if Chromium/Chrome was not installed by a wizard. However, my solution still works in any case. Besides, I found an answer on Stack Overflow proposing a code less complex:
![]() |
Hi @andersoncarlosfs, sorry for the late response, I haven't had access to my windows machine lately to test things. The issue I see with this solution is that it needs to know the exact file path (for example I have the 64bit version of Chrome installed and thus had to remove As there seems to be no perfect solution for Windows a combination of the last two discussed options might be the best option. So getting the information from registry and if that fails try to find Also I would think it would be better to remove the output = subprocess.check_output(['wmic', 'datafile', 'where', r'name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"', 'get', 'Version', '/value']) For a hardcoded string this should be no issue but as this part might be changed in the future this could be a problem |
Done! |
Done! |
Hello @danielkaiser , Please, feel free to make suggestions! Have a nice day, |
Detecting OS and installation path of Chrome on Windows