Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Determine the version of Internet Explorer installed on a local machine

0.00/5 (No votes)
18 Nov 2001 1  
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.

#include "windows.h"

#include "shlwapi.h"


HRESULT GetBrowserVersion(LPDWORD pdwMajor, LPDWORD
        pdwMinor, LPDWORD pdwBuild)
{
    HINSTANCE   hBrowser;

    if(IsBadWritePtr(pdwMajor, sizeof(DWORD))
        || IsBadWritePtr(pdwMinor, sizeof(DWORD))
        || IsBadWritePtr(pdwBuild, sizeof(DWORD)))
        return E_INVALIDARG;

    *pdwMajor = 0;
    *pdwMinor = 0;
    *pdwBuild = 0;

    //Load the DLL.

    hBrowser = LoadLibrary(TEXT("shdocvw.dll"));

    if(hBrowser) 
    {

        HRESULT  hr = S_OK;
        DLLGETVERSIONPROC pDllGetVersion;
        pDllGetVersion =
            (DLLGETVERSIONPROC)GetProcAddress(hBrowser,
                TEXT("DllGetVersion"));

        if(pDllGetVersion) 
        {

            DLLVERSIONINFO    dvi;
            ZeroMemory(&dvi, sizeof(dvi));
            dvi.cbSize = sizeof(dvi);
            hr = (*pDllGetVersion)(&dvi);

            if(SUCCEEDED(hr)) 
            {
                *pdwMajor = dvi.dwMajorVersion;
                *pdwMinor = dvi.dwMinorVersion;
                *pdwBuild = dvi.dwBuildNumber;
            }

        } 
        else 
        {
            //If GetProcAddress failed, there is a problem 

            // with the DLL.


            hr = E_FAIL;
        }
        FreeLibrary(hBrowser);
        return hr;
    }
    return E_FAIL;
}

Internet Explorer version history

The version number of Internet Explorer uses the following format:

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

Full listing of Internet Explorer versions

VersionProduct
4.40.308 Internet Explorer 1.0 (Plus!)
4.40.520 Internet Explorer 2.0
4.70.1155 Internet Explorer 3.0
4.70.1158 Internet Explorer 3.0 (OSR2)
4.70.1215 Internet Explorer 3.01
4.70.1300 Internet Explorer 3.02 and 3.02a
4.71.544 Internet Explorer 4.0 Platform Preview 1.0 (PP1)
4.71.1008.3 Internet Explorer 4.0 Platform Preview 2.0 (PP2)
4.71.1712.6 Internet Explorer 4.0
4.72.2106.8 Internet Explorer 4.01
4.72.3110.8 Internet Explorer 4.01 Service Pack 1 (SP1)
4.72.3612.1713 Internet Explorer 4.01 Service Pack 2 (SP2)
5.00.0518.10 Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1309 Internet Explorer 5 Beta (Beta 2)
5.00.2014.0216 Internet Explorer 5
5.00.2314.1003 Internet Explorer 5 (Office 2000)
5.00.2614.3500 Internet Explorer 5 (Windows 98 Second Edition)
5.00.2516.1900 Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)
5.00.2919.800 Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307 Internet Explorer 5.01 (Also included with Office 2000 SR-1, but not installed by default)
5.00.2920.0000 Internet Explorer 5.01 (Windows 2000, build 5.00.2195)
5.00.3103.1000 Internet Explorer 5.01 SP1 (Windows 2000)
5.00.3105.0106 Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)
5.00.3314.2101 Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)
5.00.3315.1000 Internet Explorer 5.01 SP2 (Windows 2000)
5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
5.50.4030.2400 Internet Explorer 5.5 & Internet Tools Beta
5.50.4134.0100 Windows Me (4.90.3000)
5.50.4134.0600 Internet Explorer 5.5
5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
5.50.4522.1800 Internet Explorer 5.5 Service Pack 1
5.50.4807.2300 Internet Explorer 5.5 Service Pack 2
6.00.2462.0000 Internet Explorer 6 Public Preview (Beta)
6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
6.00.2600.0000 Internet Explorer 6

Full listing of Shdocvw.dll versions

VersionProduct
4.70.1155 Internet Explorer 3.0
4.70.1158 Internet Explorer 3.0 (OSR2)
4.70.1215 Internet Explorer 3.01
4.70.1300 Internet Explorer 3.02 and 3.02a
4.71.1008.3 Internet Explorer 4.0 PP2
4.71.1712.5 Internet Explorer 4.0
4.72.2106.7 Internet Explorer 4.01
4.72.3110.3 Internet Explorer 4.01 Service Pack 1
4.72.3612.1707 Internet Explorer 4.01 SP2
4.72.3711.2900Internet Explorer 4.x with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.0518.5 Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1308Internet Explorer 5 Beta (Beta 2)
5.00.2014.213 Internet Explorer 5
5.00.2314.1000Internet Explorer 5 (Office 2000)
5.00.2516.1900 Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)
5.00.2614.3500Internet Explorer 5 (Windows 98 Second Edition)
5.00.2717.2000 Internet Explorer 5 with Update for "Malformed Favorites Icon" Security Issue installed.
5.00.2721.1400Internet Explorer 5 with Update for "ImportExport Favorites()" Security Issue installed.
5.00.2723.2900 Internet Explorer 5.0 with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.2919.800 Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800 Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307Internet Explorer 5.01 (Also included with Office 2000 SR-1, but not installed by default)
5.00.2919.6400 Internet Explorer 5.01 with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.2920.0000Internet Explorer 5.01 (Windows 2000, build 5.00.2195)
5.00.3103.1000 Internet Explorer 5.01 SP1 (Windows 2000)
5.00.3105.0106Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)
5.00.3314.2100 Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)
5.00.3315.2879Internet Explorer 5.01 SP2 (Windows 2000)
5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
5.50.4030.2400Internet Explorer 5.5 & Internet Tools Beta
5.50.4134.0100 Windows Me (4.90.3000)
5.50.4134.0600Internet Explorer 5.5
5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
5.50.4522.1800Internet Explorer 5.5 Service Pack 1
5.50.4807.2300 Internet Explorer 5.5 Service Pack 2
6.00.2462.0000Internet Explorer 6 Public Preview (Beta)
6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
6.00.2600.0000Internet Explorer 6

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.

A list of licenses authors might use can be found here