Skip to content

Offer to install WebView2, with an administrator prompt, on Windows - #4

Merged
beingsuz merged 1 commit into
claude/project-thread-lagm2gfrom
claude/project-thread-0i0dc9
Sep 26, 2026
Merged

beingsuz merged 1 commit into
claude/project-thread-lagm2gfrom
claude/project-thread-0i0dc9

Conversation

@beingsuz

Copy link
Copy Markdown
Contributor

Requested by beingsuz · project thread

Stacked on #3: the base is #3's branch, so this diff shows only the WebView2 work. Once #3 merges, this retargets to main. It goes with UnhingedSoftware/kirie's "Show web wallpapers on Windows through WebView2".

Before: on Windows, web wallpapers could not run at all, and nothing in haru knew what they would need.

After: kirie shows web wallpapers on Windows in the Microsoft Edge WebView2 Runtime. When a machine does not have it, the install-kirie prompt offers "Also install WebView2, for web wallpapers", and Settings › Renderer shows whether it is installed, with an Install WebView2… button. Either one downloads Microsoft's installer, and Windows puts up its administrator (UAC) prompt before it runs.

The downloaded installer is run as administrator, so haru checks it first: it must carry a valid Authenticode signature from Microsoft Corporation, or it is not run.

How:

  • Detection: haru_apply::webview2::installed() reads the runtime's pv value from the registry keys Microsoft's guidance names (per-machine, both registry views, and per-user). It treats an empty value or 0.0.0.0 as not installed.
  • Install: install() downloads the Evergreen bootstrapper from Microsoft's fwlink. A PowerShell script then checks it with Get-AuthenticodeSignature and runs it with Start-Process -Verb RunAs -Wait and /silent /install. A declined prompt, a bad signature and a failed installer each come back as their own message.
  • After a failed WebView2 install: a good kirie install is kept, and the prompt says web wallpapers will not run yet.

How it was tested

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace are clean on Linux.
  • The same clippy run is clean for x86_64-pc-windows-gnu.
  • New tests cover reading the version from reg output (including the leftover-key cases) and that the script checks the signature before it elevates, including a path containing a quote.

Not tested: nothing here has run on Windows. In particular, the UAC prompt, the signature check and the bootstrapper's /silent /install have not been seen working.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QJnt7JtdtiqnVCP9GYqUhK


Generated by Claude Code

kirie now shows web wallpapers on Windows in Microsoft Edge WebView2, a
system component that Windows 11 ships and most Windows 10 machines have.
For the ones that do not, haru can now install it.

haru reads the runtime's version from the registry, where Microsoft's
guidance says to look. When it is missing, the install-kirie prompt offers
to install it too, and Settings > Renderer has an Install WebView2 button.
Either one downloads Microsoft's Evergreen bootstrapper, refuses to run it
unless it carries a valid Authenticode signature from Microsoft
Corporation, and runs it through Start-Process -Verb RunAs, so Windows puts
up its administrator prompt and the runtime is installed for every account.
Declining the prompt is reported as that, and a failed WebView2 install
never undoes a good kirie install.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QJnt7JtdtiqnVCP9GYqUhK
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@beingsuz beingsuz self-assigned this Sep 26, 2026
@beingsuz
beingsuz merged commit 4259046 into claude/project-thread-lagm2g Sep 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants