I would like to know is there are any possibility to get a list of installed browsers on the computer using c#? I'm using Selenium WebDriver in my task and I need to know which browsers are installed because in Selenium I can only run a specific browser, for example for Firefox it will be:
IWebDriver driver = new FirefoxDriver();
I will appreciate any help.
Look at localmachine registry...
As far as I know there is no list of browsers in Windows.
However you could check for browser's existence by simply testing the *.exe file's existence:
I've written a NuGet package for this: https://www.nuget.org/packages/MintPlayer.PlatformBrowser/ targetting .net core.
You can get a list of all installed webbrowsers (including Edge) and the default webbrowser. I've also written a package with a dialog to let you pick a browser: https://www.nuget.org/packages/MintPlayer.BrowserDialog/
You also need to take into account the machine architecture (x64 vs x86) and the fact that Microsoft Edge will not be under the specified key. Here is what I ended up using (based on multiple solutions found online):
And the object returned is a simple DTO: