2

What is the best way (preferably using Windows Registry) in C# to detect that Microsoft Edge Chromium is installed and not detect at the same time that Edge is still in system while Chromium should override "old" Edge?

For detecting old Edge usually we use Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Packages\Microsoft.MicrosoftEdge_ package in registry.

Sergey Lobanov
  • 365
  • 3
  • 14

3 Answers3

3

I suggest you check the browser entry at the location below.

HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet

or

HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet

The subkey HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet describes the Internet browser that is started when the user clicks the Internet icon on the Start menu. If that subkey is blank or missing, then the Internet icon on the Start menu is set to the system default stored in the second location at HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet , which describes all Internet browser applications that are installed on the system.

If MS Edge Chromium is installed then it will be on the list.

enter image description here

References:

  1. How to find all the browsers installed on a machine

  2. How to Register an Internet Browser or Email Client With the Windows Start Menu

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19
  • To separate old Edge from new Chromium (there could be only one in system - Microsoft hides old one if Chromium installed) we assume that if Microsoft Edge is in list of "StartMenuInternet" registry then there is Edge Chromium, otherwise we go check PackageRepository like described in question. – Sergey Lobanov Jan 21 '20 at 16:01
1

1) Find C:\Windows\SystemApps\Microsoft.MicrosoftEdge_.....\AppxManifest.xml

2) Parse AppxManifest.xml, find Version, example

Version="44.18362.449.0"

3) Check (pseudocode)

If (Version > 79) {Blink}
Else {EdgeHtml}

Release history

Igor
  • 23
  • 5
  • Looks like mentioned version corresponds only to old Edge (not Chromium). Is there a way to find out it using Windows registry? – Sergey Lobanov Jan 20 '20 at 14:41
  • Folder name \HKEY_CLASSES_ROOT\ActivatableClasses\Package\Microsoft.MicrosoftEdge_44.18362.449.0_neutral__..... – Igor Jan 20 '20 at 16:31
0

Edge Chromium information can be found at HKEY_CURRENT_USER\Software\Microsoft\Edge\BLBeacon.

You can use Registry class to get Edge version from C# by specifying the registry key.

    public static string GetEdgeVersion()
    {
        string edgeVersion = string.Empty;
        const string edgeRegistryKey = @"SOFTWARE\Microsoft\Edge\BLBeacon";
        const string edgeRegistryValue = "version";

        using (RegistryKey key = Registry.CurrentUser.OpenSubKey(edgeRegistryKey))
        {
            if (key != null)
            {
                edgeVersion = key.GetValue(edgeRegistryValue)?.ToString();
            }
        }

        return edgeVersion;
    }
haryps
  • 49
  • 1
  • 4