Skip to content

Embed the WebView2 bootstrapper instead of downloading it at install time - #7820

Merged
danielhanchen merged 1 commit into
mainfrom
desktop-embed-webview2-bootstrapper
Aug 4, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
desktop-embed-webview2-bootstrapper

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What this changes

bundle.windows.webviewInstallMode is currently Tauri's default, downloadBootstrapper. This switches it to embedBootstrapper.

Why

With the default, when WebView2 is missing the installer does this (studio/src-tauri/windows/installer.nsi):

NSISdl::download "https://go.microsoft.com/fwlink/p/?LinkId=2124703" "$TEMP\MicrosoftEdgeWebview2Setup.exe"
...
ExecWait "$6 ${WEBVIEW2INSTALLERARGS} /install" $1

Fetch an executable from the internet, then run it silently. That is the most dropper shaped behaviour in the bundle, and it is a heuristic cost paid on every release regardless of whether the download ever happens.

embedBootstrapper ships the bootstrapper inside the installer instead, for about 1.8MB. Whatever downloading remains is done by a Microsoft signed binary rather than by our NSIS stub.

offlineInstaller would remove the network requirement entirely, but it costs about 127MB, which would also push the bundle past the 50MB cap on Microsoft false positive submissions.

Scope

The registry check ahead of it is unchanged:

ReadRegStr $4 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
${If} $4 == ""

WebView2 ships preinstalled on Windows 11 and was rolled out to Windows 10, so on the large majority of machines none of this path runs at all. This is about the fallback.

Honest framing

This is hardening, not a fix for a specific report. The behaviour is present in both 0.1.51-beta and 0.1.512-beta, so it does not explain any difference between them, and I have no measurement showing it flips a scanner verdict. It removes a download and execute step we do not need to own, and 1.8MB is a fair price for that.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 585e53b645

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The installer currently uses Tauri's downloadBootstrapper default, so when
WebView2 is missing it runs NSISdl::download against a Microsoft fwlink and
then ExecWaits the result. Fetching an executable and running it is the most
dropper-shaped thing in the bundle, and it is a heuristic cost paid on every
release.

embedBootstrapper ships the bootstrapper inside the installer instead, for
about 1.8MB. Any remaining download is done by a Microsoft-signed binary rather
than by our NSIS stub. offlineInstaller would remove the network need entirely
but costs 127MB and would push the bundle past the 50MB cap on Microsoft
submissions.

The registry check is unchanged, so on Windows 11 and most Windows 10 machines
WebView2 is already present and none of this runs.
@danielhanchen
danielhanchen force-pushed the desktop-embed-webview2-bootstrapper branch from 585e53b to 96450a3 Compare August 4, 2026 09:39
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 96450a385c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 799d656 into main Aug 4, 2026
37 of 40 checks passed
@danielhanchen
danielhanchen deleted the desktop-embed-webview2-bootstrapper branch August 4, 2026 11:12
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.

1 participant