IE is still loading instead of WebView2 on WIndows 10

#include <JuceHeader.h>

class HelloWorldEditor : public juce::AudioProcessorEditor
{
public:
    HelloWorldEditor (HelloWorldProcessor& p)
        : AudioProcessorEditor (p), processor (p)
    {   
        addAndMakeVisible (webBrowserComponent);
        webBrowserComponent.goToURL ("https://google.com");
        setSize (700, 700);
    }

    ~HelloWorldEditor() override {}

    void paint (juce::Graphics& g) override
    {
        g.fillAll (juce::Colours::black);
        g.setColour (juce::Colours::white);
        g.setFont (20.0f);
        g.drawText ("Hello World?!!!!!!!", getLocalBounds(),
                    juce::Justification::centred, true);
    }

    void resized () override 
    {
        webBrowserComponent.setBounds (getLocalBounds ());
    }

private:
    HelloWorldProcessor& processor;
    juce::WebBrowserComponent webBrowserComponent
    {
        juce::WebBrowserComponent::Options {}
        .withBackend (juce::WebBrowserComponent::Options::Backend::webview2)
        .withWinWebView2Options(juce::WebBrowserComponent::Options::WinWebView2{})
    };

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HelloWorldEditor)
};
cmake_minimum_required(VERSION 3.22)

project(AUDIO_PLUGIN_EXAMPLE VERSION 0.0.1)

set(PRODUCT_NAME "HelloWorld")

include(FetchContent)

FetchContent_Declare(
    JUCE
    GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
    GIT_TAG master 
)

FetchContent_MakeAvailable(JUCE)

juce_add_plugin(${PRODUCT_NAME}
    BUNDLE_ID "dev.helloworld.plugin"
    COMPANY_NAME "HelloWorld"
    IS_SYNTH TRUE
    NEEDS_MIDI_INPUT TRUE
    NEEDS_MIDI_OUTPUT TRUE
    AU_MAIN_TYPE kAudioUnitType_MIDIProcessor
    COPY_PLUGIN_AFTER_BUILD TRUE
    PLUGIN_MANUFACTURER_CODE hlwr
    PLUGIN_CODE Hlwr
    FORMATS AU VST3
    PRODUCT_NAME ${PRODUCT_NAME}
    NEEDS_WEB_BROWSER TRUE
    NEEDS_WEBVIEW2 TRUE
)

juce_generate_juce_header(${PRODUCT_NAME})

target_sources(${PRODUCT_NAME} PRIVATE main.cpp)

target_compile_definitions(${PRODUCT_NAME}
    PUBLIC
        JUCE_WEB_BROWSER=1
        JUCE_USE_WIN_WEBVIEW2_WITH_STATIC_LINKING=1
        JUCE_USE_CURL=0
        JUCE_VST3_CAN_REPLACE_VST2=0)

target_link_libraries(${PRODUCT_NAME}
    PRIVATE
        juce::juce_audio_utils
    PUBLIC
        juce::juce_recommended_config_flags
        juce::juce_recommended_lto_flags
        juce::juce_recommended_warning_flags)

#build.yml
name: Build VST3 on Windows

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build-windows:
    runs-on: windows-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Install WebView2 - Register package source
        shell: pwsh
        run: |
          Register-PackageSource -ProviderName NuGet -Name nugetRepository -Location https://www.nuget.org/api/v2 -Force
      
      - name: Install WebView2 - Install package
        shell: pwsh
        run: |**strong text**
          Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177 -Source nugetRepository -Force

      - name: Configure CMake
        run: cmake -B build -S . -A x64 -G "Visual Studio 17 2022"

      - name: Build project
        run: cmake --build build --config Release

      - name: Upload built VST3
        uses: actions/upload-artifact@v3
        with:
          name: vst3-files
          path: build/**/*.vst3

I wrote a simple Hello World plugin as above and am building it for Windows via GitHub Actions.
I tried loading the built VST3 on Windows 10 in various DAWs, and the results were as follows:

Ableton Live 11: Displays with WebView, but the text appears extremely blurry, almost like a blur effect.
FL Studio: The plugin doesn’t get scanned at all.
Reaper: Displays using IE instead of WebView2.
Bitwig: Displays using IE instead of WebView2.

I have no idea what the issue is. If there is a problem with my code, please let me know. When I used the Cmajor plugin, I confirmed that all WebViews (Choc) opened properly, and the VST3 scan worked without any issues.
Additionally, setting it up on Windows is too complicated, and I wish there were proper documentation explaining this clearly.

I just tried loading VST3 into each DAW on Windows 11, and they all crash without even opening. On Windows 10, at least they opened with IE, but on Windows 11, everything crashes. Could there be some code internally depending on Internet Explorer within the web browser component? I hope the issue lies in my code… Please help me…

By adding the following line, I fixed the fallback to IE on Windows 10.

.withWinWebView2Options( juce::WebBrowserComponent::Options::WinWebView2{}.withUserDataFolder( juce::File::getSpecialLocation(juce::File::SpecialLocationType::tempDirectory)) )

The most serious issue, however, is that it still crashes immediately upon launch in all DAWs on Windows 11. It opens fine on Windows 10. What could be the problem?

Can you trigger such a crash with the JUCE provided WebViewPluginDemo?

My guess is that you’re using dynamic linking, but you haven’t installed the WebView2.dll in a suitable search location.

Can you try using static linking? To do this you need to add the JUCE_USE_WIN_WEBVIEW2_WITH_STATIC_LINKING=1 compile definition to your plugin target. If you’re using the projucer you can find this option as a drop down menu under the juce_gui_extra module settings.

I have already included JUCE_USE_WIN_WEBVIEW2_WITH_STATIC_LINKING=1 in my CMakeLists. However, someone else’s Windows 10 is still crashing. Could there be an issue with my CMake or .yml files?

- name: Install WebView2 - Register package source
        shell: pwsh
        run: |
          Register-PackageSource -ProviderName NuGet -Name nugetRepository -Location https://www.nuget.org/api/v2 -Force
      
      - name: Install WebView2 - Install package
        shell: pwsh
        run: |**strong text**
          Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177 -Source nugetRepository -Force

I am installing through GitHub Actions in my .yml as described above. The build works fine. The problem is that it crashes on a few Windows computers when opened.

Internet Explorer is supposed to be disabled in Windows 10. Do you mean the Edge browser?

Just to be clear are you seeing crashes only on 10, 11 or both?

It’s difficult to say what could be the problem. If you run the plugin under a debugger it should trigger a breakpoint when the crash happens and maybe you can find out more from the stack trace.