detect Internet Explorer 11 availability

Rudolf Meier 291 Reputation points
2021-12-01T21:44:47.577+00:00

I'm currently building a debugging extension for Visual Studio. Therefore I'd like to identify all available browsers. Now, I know, that Windows 10 always contains the Internet Explorer 11 but Windows 11 not. The problem now is, that I cannot detect the OS version (GetVersionEx and so on don't work anymore)... the problem is, that Microsofts idea is, that we should "detect if the api is available and not which OS version you are running on" ... ok... in most cases ok... but in this case... can someone tell me how this should work?
Oh, and next question... how can I detect and find the IE installation at all? ... I currently do it via the Classes\IE.AssocFile.HTM\shell\open\command registry key... but the problem is, that on Windows 11 there is also an "Internet Explorer" which is in fact a renamed Edge (or hardlinked or whatever) ... so, again a backwards compatibility that is f* hard to work around... why? what's the "official" idea for doing this???

Windows development | Windows API - Win32
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 90,681 Reputation points
    2021-12-02T08:21:57.393+00:00

    On Windows 10 and before, the IE path is read from

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
    IEXPLORE.EXE

    But I cannot test on Windows 11...

    1 person found this answer helpful.

  2. Xiaopo Yang - MSFT 12,731 Reputation points Microsoft External Staff
    2021-12-02T02:09:39.86+00:00

    Hello,

    Welcome to Microsoft Q&A!

    I found the Computer\HKEY_CLASSES_ROOT\.html\OpenWithProgids registry lists all available browsers(not "official" idea).

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Rudolf Meier 291 Reputation points
    2022-10-06T09:13:48.557+00:00

    Well, what I do now is

    1) read "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\IE.AssocFile.HTM\shell\opencommand"

    2) look at the file I find at this specific path and if the ProductBuildPart of its version is >= 22000 then I assume Windows 11 and thus a rediretion towards Edge and thus no Internet Explorer

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.