Check if WebBrowser is installed
All tutorials created in C# to be posted in here.
1 post
Page 1 of 1
A few days ago i ran into a problem, I needed to know which WebBrowsers are installed, this can be difficult because not everyone installs them in the same directory. But after a bit of research i came up with this code
This method checks all the names in that list until it finds one that contains the name of the WebBrowser you want to see if is installed. Like this for example
Code: Select all
Apparently Windows has a list of the installed WebBrowsers in the Registry, so after i found that the rest was piece of cake. private bool BrowserInstalled(string browserName)
{
//-- Browser Existance
bool _IsInstalled = false;
//-- Get installed browsers
RegistryKey _BrowsersNode = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Clients\StartMenuInternet");
//-- Search all browsers
foreach (string _Browser in _BrowsersNode.GetSubKeyNames())
{
if (_Browser.ToLower().Contains(browserName.ToLower()))
{
_IsInstalled = true;
break;
}
}
//-- Return browser existace
return _IsInstalled;
}
This method checks all the names in that list until it finds one that contains the name of the WebBrowser you want to see if is installed. Like this for example
Code: Select all
I only tried this on Windows 7, but i believe it will work on others too. if (BrowserInstalled("firefox")) //-- firefox, iexplore, chrome, opera, etc...
{
MessageBox.Show("Mozilla Firefox is installed");
}
You can find me on Facebook or on Skype mihai_92b
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023