Determine the version of Internet Explorer installed on a local machine

Two ways to programmatically determine the version of Internet Explorer installed on a local machine

Introduction

To date, Microsoft has released a total of six major
versions of the Internet
Explorer browser. But lesser known, is the fact that there
are altogether thirty-six different minor versions of
Internet Explorer out
there in the field. Identifying them programmatically can
be a real headache, and
especially so for the earlier versions.

Firstly, the version numbers used internally by
Microsoft and that as we, the
consumers, know it are a world apart (until version 5.5).
E.g. Internet Explorer
2.0 carries the version number "4.40.520". I was expecting
to see something like
"2.0.xxx". Furthermore, the version numbers do not
increment in the same manner
as that in the product name. E.g. Internet Explorer 3.0
carries the version
number "4.70.1155", instead of something like "5.x.x" since
version 2.0 starts
with a "4.x.x". You will have to use a lookup table
to match the version numbers against the product names.

Then there is the small matter of retrieving the version
number programmatically.
Each major version (until version 4.0) of Internet Explorer
introduces a different
way of identifying the version number from the registry; It
first started with the IVer string, then the Build
string and finally the Version string.

Microsoft seems to have come to their senses finally.
The version numbers now
correspond to their marketing counterparts (E.g. Internet
Explorer 5.5 carries the
version number "5.50.4134.0600"), and we can get the full
version string from the
Registry using the Version string value.

But if you are still, like me, required to determine
versions before Internet
Explorer 4.0, then take an aspirin for your headache before
going any further.

Disclaimer

This article contains information
extracted from MSDN.

Determining the Internet Explorer Version from the
Registry

The version number of the installed Internet Explorer
can be found under the
following registry key:

HKEY_LOCAL_MACHINE\
Software\
Microsoft\
Internet Explorer

Internet Explorer 1.0 for Windows 95 (included
with Microsoft Plus! for
Windows 95) has an IVer string value under
this key, which it sets to
"100".

Internet Explorer 2.0 for Windows 95 updates the IVer string
value to "102", and adds a Build string value
under the same key, which
it sets to "520".

Versions of Internet Explorer that are included with
Windows NT 4.0 do not add
the Build value to the registry, but they do
update the IVer
string value to "101".

Internet Explorer 3.x modifies the Build string value and
updates the IVer string value to "103". Note
that the Build
value in this version is a string that contains the
four-character build number
(E.g. "1300" for Internet Explorer 3.02).

For Internet Explorer 4.0 and later, the Build value is a
string that contains a five-character value, followed by a
period and four more
characters, in the following format:

major-version-build-number.sub-build-number

E.g. the Build value for Internet Explorer
5 is "52014.0216."

In addition, it adds a Version string value
under the same key, in
the following format.

major-version.minor-version.build-number.sub-build-number

E.g. the Version value for Internet
Explorer 5 is "5.00.2014.0216".

If none of these values is in the registry,
Internet Explorer is not installed
properly or at all.

Determining the Internet Explorer Version from
Shdocvw.dll

You may use the version number of the Shdocvw.dll (Shell
Document Object and
Control Library) file to determine the version of Internet
Explorer installed.
However, note that this approach can only be used on Internet Explorer 3.0 and
later since this file does not exist in previous
versions of Internet Explorer.

Also, do take note that the version number of this dll
is not the same as that
stored in the registry. (Although the later versions are
starting to have the same
numbers.) A table listing the version numbers of the
Shdocvw.dll file and the
corresponding versions of Internet Explorer may be found
here.

The Shdocvw.dll file is installed in the Windows\System
folder in Windows 95/98,
and in the Winnt\System32 folder in Windows NT/2000. If the
Shdocvw.dll file does not
exist, Internet Explorer 3.0 or later is not installed
properly or at all.

The following WIN32 function retrieves the major
version, minor version and build
numbers of the Shdocvw.dll that is installed on the local
system.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

I have written a small Delphi function that returns the version text based on the version number.
I have imported your list and converted it into Delphi (pascal) syntax.

Is it ok if i donate this code to the Jedi Code Library Project ?
Jedi Code Library is a free, open source Delphi Library - similar to The Code Project - but for Delphi Developers (http://www.delphi-jedi.org)

Disclaimer:Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.

Just in case anyone is interested in getting Netscape's version in code...

For Navigator 4.x, you can use the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Netscape Navigator\

Look for the CurrentVersion string value. Unlike Microsoft, this string value is pretty straight-forward; It gives the version of the product and the installed language. E.G. 4.0 (en) for version 4.0 and installed language is English.

For Netscape 6.x, the CurrentVersion string value is found under the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Netscape 6\

In case you are wondering, I didn't skip Netscape 5.x. There never was a 5.x! Oh, and I couldn't get any info for version 3.x and below. I would appreciate if anyone out there can tell me.

Sidney Chong wrote:In case you are wondering, I didn't skip Netscape 5.x. There never was a 5.x! Oh, and I couldn't get any info for version 3.x and below. I would appreciate if anyone out there can tell me.

There originally was an idea for Netscape 5, but it was to slow to be a good browser. This was because the people thought it would be wise to develop it within Java for a great part, but after all, this didn't work out properly, because Java lacks the speed which is needed by such an application.