From 9e7e20606e0f229f89e88d83cac2dd6cd4d103f8 Mon Sep 17 00:00:00 2001 From: Boof2015 <75185879+Boof2015@users.noreply.github.com> Date: Tue, 2 Jun 2026 09:22:23 -0400 Subject: [PATCH] fix vsts not loading on windows --- plugin/Source/PluginEditor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugin/Source/PluginEditor.cpp b/plugin/Source/PluginEditor.cpp index d0d0384..f23ce89 100644 --- a/plugin/Source/PluginEditor.cpp +++ b/plugin/Source/PluginEditor.cpp @@ -86,6 +86,21 @@ namespace .withEventListener("prismReady", [&editor](juce::var) { editor.onPrismReady(); }) .withEventListener("prismSpectrogramConfig", [&editor](juce::var v) { editor.onScopeNativeConfig(std::move(v)); }) .withEventListener("prismSettingsPanel", [&editor](juce::var v) { editor.onSettingsPanel(std::move(v)); }); + + // WebView2's default user-data folder is created next to the host executable. + // For plugins installed under Program Files\Common Files\VST3\..., that path + // is read-only to the (non-admin) DAW process → WebView2 silently fails to + // initialise → blank webview → "navigation to the webpage was canceled". + // Point it at a writable per-user folder instead (JUCE's docs flag this + // explicitly for plugin projects). Ignored on non-Windows builds. + const auto webView2DataDir = + juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory) + .getChildFile("prism") + .getChildFile("WebView2"); + webView2DataDir.createDirectory(); + options = options.withWinWebView2Options( + juce::WebBrowserComponent::Options::WinWebView2{}.withUserDataFolder(webView2DataDir)); + #if ! PRISM_USE_DEV_SERVER options = options.withResourceProvider([](const auto& url) { return provideResource(url); }); #endif