fix(windows): offer WebView2 runtime download when it is missing#18
Merged
Christian-Katzmann merged 2 commits intoJun 4, 2026
Conversation
A WebView2-less machine (Windows LTSC/Server and some clean installs ship without the Evergreen runtime) hit the generic catch in OnLoaded, which showed a developer-facing message pointing at docs/WINDOWS.md - useless to an end user who just double-clicked a Start Menu shortcut. Catch WebView2RuntimeNotFoundException specifically and offer to open Microsoft's download page (Yes/No -> default browser). Kept separate from the generic handler so the installer is only suggested when the runtime is actually the problem; the catch-all now also names the URL as a hint. Validated on Windows 11: forcing a bogus runtime folder triggers the not-found path, the Yes/No dialog shows, and Yes opens the download page in the default browser. Compiles clean (only the pre-existing DPI manifest warning).
Reviewer's GuideAdds explicit handling for missing WebView2 runtime on Windows by prompting end users to install it from Microsoft’s download page, and updates the changelog to document the behavior change. Sequence diagram for handling missing WebView2 runtime on window loadsequenceDiagram
actor User
participant MainWindow
participant Web
participant MessageBox
participant DefaultBrowser
User->>MainWindow: OnLoaded
MainWindow->>Web: EnsureCoreWebView2Async
alt WebView2 runtime missing
Web-->>MainWindow: WebView2RuntimeNotFoundException
MainWindow->>MessageBox: MessageBox.Show(YesNo Warning)
MessageBox-->>MainWindow: MessageBoxResult.Yes
opt User clicks Yes
MainWindow->>DefaultBrowser: OpenInDefaultBrowser(WebView2DownloadUrl)
end
else Other WebView2 failure
Web-->>MainWindow: Exception
MainWindow->>MessageBox: MessageBox.Show(OK Error with WebView2DownloadUrl)
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The WebView2 download URL is now hard-coded in MainWindow; consider centralizing it in a shared config or constants module so it can be reused or updated without touching UI code.
- The new user-facing message strings are embedded directly in code and use explicit "\n" separators; consider using
Environment.NewLineand a localization-friendly pattern (e.g., resource files) to make future translation or wording changes easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The WebView2 download URL is now hard-coded in MainWindow; consider centralizing it in a shared config or constants module so it can be reused or updated without touching UI code.
- The new user-facing message strings are embedded directly in code and use explicit "\n" separators; consider using `Environment.NewLine` and a localization-friendly pattern (e.g., resource files) to make future translation or wording changes easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
# Conflicts: # CHANGELOG.md
Christian-Katzmann
added a commit
that referenced
this pull request
Jun 4, 2026
…-runtime fixes (#17, #18) He went from first real-hardware validator to the Windows beta's recurring real-hardware tester — three fixes now, each traced and verified on Windows 11 (window title #8, taskbar right-click app name #17, WebView2-runtime-missing path #18). Refresh his existing nudge line to reflect that arc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
|
Merged — thank you, @Firnschnee. Catching Credited in the README's Community nudge alongside your other Windows fixes. Thanks again. |
Christian-Katzmann
added a commit
that referenced
this pull request
Jun 4, 2026
…e landed (#17, #18) The recruitment paragraph still framed #8 as the single real-hardware milestone ("first run … window-title bug"). It's had a run of fixes since (#17 taskbar app name, #18 WebView2-runtime-missing path), so update it to "a run of fixes since — a real start, not a finish line." No overclaim — it still says "needing more," the author still runs only macOS, and the concrete fix-by-fix list stays in the README Community nudge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third item from my real-hardware testing notes on #8: the WebView2-runtime-missing error message.
The problem
On a machine without the WebView2 Evergreen runtime (Windows LTSC/Server and some clean installs ship without it -- my test box was exactly this),
OnLoadedhit the genericcatch (Exception)and showed a developer-facing message pointing atdocs/WINDOWS.md. Useless to an end user who just double-clicked a Start Menu shortcut and has no idea what a "maintainer checklist" is.The fix
Catch
WebView2RuntimeNotFoundExceptionspecifically and offer to open Microsoft's download page (Yes/No -> default browser via the existingOpenInDefaultBrowserhelper). Kept separate from the generic handler on purpose: the installer is only suggested when the runtime is genuinely the problem, not for an arbitrary crash. The catch-all handler now also names the download URL as a hint.Verification (Windows 11)
Couldn't uninstall my runtime, so I forced the failure by pointing
WEBVIEW2_BROWSER_EXECUTABLE_FOLDERat a non-existent folder:<App> needs the Microsoft Edge WebView2 runtime...).WebView2RuntimeNotFoundExceptionis inMicrosoft.Web.WebView2.Core, already imported); only the pre-existing DPI manifest warning remains.Notes
MainWindow.xaml.cs(+ changelog). Both edit the changelog near the same line, so whichever merges second will want a trivial conflict resolution.windows-latestCI (the runner has the runtime), same as it can't be from macOS -- hence the manual hardware check above.Summary by Sourcery
Improve Windows WebView2 runtime error handling to guide end users when the runtime is missing.
Bug Fixes:
Documentation: