How do I detect which version of Internet Explorer is installed?

25,718

Solution 1

You have to look in the registry, but not in uninstall key. Instead, find the key at HKLM\Software\Microsoft\Internet Explorer and read the value named Version.

For newer versions (IE 10 and above), Version is 9.x (for example, IE 10 is 9.10.something), and the new svcVersion value gives the true IE version.

This technique is even recommended by Microsoft; see here.

Solution 2

The Version value doesn't seem to include the Internet Explorer version information that you would most likely need. Instead, look at either svcVersion or svcUpdateVersion for the information.

As an example, I am running IE 10 and if I query the Version registry value 9.10.9200.16798 is returned but if I query svcUpdateVersion 10.0.13 is returned. The latter corresponds to the actual Internet Explorer version which is 10.

REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v Version HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer Version REG_SZ 9.10.9200.16798

REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v svcUpdateVersion HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer svcUpdateVersion REG_SZ 10.0.13

REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v svcVersion HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer svcVersion REG_SZ 10.0.9200.16798

Solution 3

If you require to know the IE version into a web application you can get the User-Agent or use javascript:

You got here a Microsoft sample of how to get the internet Explorer version http://msdn.microsoft.com/en-us/library/ms537509(VS.85).aspx

If you require to detect the IE Version into a Desktop program with X language you need to read the Windows registry

This registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer contains the attribute Version with the IE version

Solution 4

I'd like to challenge the conventional wisdom of inspecting the registry. Consider the reference source for System.Windows.Forms.WebView.Version:

string mshtmlPath = 
   Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "mshtml.dll");
FileVersionInfofvi = FileVersionInfo.GetVersionInfo(mshtmlPath);
return new Version(
             fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);

Presumably, the guys who wrote the WebView class knew what they were doing.

Share:
25,718
Maltrap
Author by

Maltrap

Updated on August 14, 2020

Comments

  • Maltrap
    Maltrap almost 4 years

    Is the best way to look under the Uninstall key of the Windows Registry? Is there a Microsoft API call which provides this info and is it supported from XP onwards?

    What is the best way to detect which version of Internet Explorer is installed on the local machine?

  • EricLaw
    EricLaw over 13 years
    Surprisingly enough, there's no API for this, and checking this registry key is generally accepted as the best choice.
  • Ofek Shilon
    Ofek Shilon over 6 years
    Link is (probably) broken