fix: improve guessing of chrome executable path on windows#1294
fix: improve guessing of chrome executable path on windows#1294B4nan merged 4 commits intoapify:masterfrom audiBookning:fix-multi-languages-win32-typicalChromeExecutablePath
Conversation
|
Thanks for the suggestion, but let's first start with the problem you are trying to solve. Can you describe it more in detail? How can we test it ourselves? The proposed change itself looks a bit funky, given the string you are using regexes on is static, I can't see any reason to actually do this via regexp. You should be able to adjust the chrome path via |
I was experimenting with this package as a prospect for a future project. I tried to add some non-existent feature to it but was blocked right away when the tests failed (ex: puppeteer_launcher.test - supports useChrome option ).
Yes you are right. At the time i used this more general code to deal with any 'environment variable' on other places and didn't clean it latter. I can change it to something simpler like for example. return `${process.env['ProgramFiles(x86)']}\\Google\\Chrome\\Application\\chrome.exe`
There seem to be already some CI test with Windows OS in this repo. That may be the best path. I see that they are failing. Some of the errors looks similar to a situation i had. Reason for my PR: thanks for taking the time to give a quick feedback even on the week end 🙂 |
|
AFAIK the path is dependent on the Chrome version. Maybe we should support a fallback to the old one. |
Tests in the CI are passing on windows too in master, they are just too flaky, so failing rather randomly because of some timeouts, definitely not because of this. I believe they also work locally on windows, right @vladfrangu? Seeing the tests in your branch, they actually fail because chrome is not installed on that path you changed. In other words, you fixed your local environment, but in CI it is installed elsewhere and it breaks. We should check if there is something on the path and fallback to the currently defined one. I would also like to see a fallback in case the env var is not set. Did some googling and I would actually say that the problem is not about languages, you just installed 32 bit version of chrome, while normally it is 64 bit that lives in the path we have hardcoded. |
|
Yes the return `${process.env['ProgramFiles']}\\Google\\Chrome\\Application\\chrome.exe`would be the correct one? Note that Chrome installing on path C:\Program Files (x86) even on 64bit windows machines, is an old issue that was only solved by mid 2020, i think. This path is still normal for people that have installed their chrome browser before that date (like me). |
|
It helps with the CI tests, so as long as it works for you, I guess it's the right one :] I would still like to see a fallback in case the env var is not present, so we preserve the old behaviour, other than that I am happy to merge. Would appreciate if you could check this locally too @vladfrangu |
|
I just saw my last commit and realized that it couldn't be correct. It was already very late, when i made it and a little tired. |
|
Thanks! |
Reupload: Corrected conventions on naming conventions
A PR for the case where the user windows OS is in a different language and the 'Typical Chrome Executable Path' is on a 'non-English-standard' ProgramFiles folder.
In windows, it can be gotten by the environment variable ProgramFiles(x86).