Files
zipgandzipg bc0734ab25 fix(windows): 区分 WebView2 运行时问题与安全软件拦截,新增有界兼容启动阶梯 (#13036)
* fix(windows): diagnose WebView2 runtime failures and recover startup

On Windows the "main window never appears" failure has three very different
causes that used to share one misleading "enterprise compatibility mode"
retry: WebView2 runtime missing, WebView2 runtime registered but damaged, and
a security product blocking WebView2. This change separates them before Tauri
creates a window and turns the single retry into a bounded recovery ladder.

- webview2_preflight: three-state runtime health (available / missing /
  registered_but_damaged), runtime version and install kind, installed security
  products, msedgewebview2 process count, Zone.Identifier and integrity level,
  plus an STA environment-creation probe with a hard timeout and HRESULT capture
- startup_recovery: 11-profile bounded compatibility ladder (isolated user data,
  sandbox/GPU off, RendererCodeIntegrity off for old runtimes, in-process GPU,
  temp data, scan delay, warm-up child, AppCompat Windows 8 layer, elevated
  relaunch, relocated copy, single-process experiment) with per-profile user data
  folders, fast-fail window probing, chain handoff through environment variables,
  bounded watchdog and silent auto-remembering of the winning profile
- startup_messages: native-dialog i18n catalog (zh-CN / zh-TW / en, English
  fallback); runtime problems point at the Windows 10 offline package that
  bundles WebView2, support codes stay in startup.log, success stays silent
- windows_appcompat: reversible per-user AppCompat Windows 8 layer used by a
  late profile
- wry: make WEBVIEW2_USER_DATA_FOLDER / WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
  effective at runtime (union --disable-features lists) and honor
  WEBVIEW2_BROWSER_EXECUTABLE_FOLDER on any Windows version
- bounded diagnostic logging (runtime health, attempts, stages, HRESULTs) and
  DBX_DISABLE_* / DBX_TRY_COMPAT_ON_BROKEN_WEBVIEW2 escape hatches

The standard startup path is unchanged on machines with a healthy runtime.

* test(transfer): initialize target_column_name_case in live Oracle transfer test

The column-name-case feature added a required field to TransferRequest but this
live Oracle test initializer was not updated, so rust-test/rust-fmt-clippy fail on
main as soon as the Rust jobs run (E0063). This is a pre-existing CI blocker for
this PR; keep the fix as a separate commit so it can be split out if preferred.

* test(windows): fix inverted marker assertions and make them version-agnostic

The marker test asserted expected_marker_mismatch(...) == true for the matching
version/profile pair (inverted), and hard-coded 0.6.49 while the marker is scoped
to CARGO_PKG_VERSION (0.6.50 on main). Use the crate version and assert both
directions; this is what failed rust-test on CI.

* fix(windows): preserve existing AppCompat layers and track ownership

* style(windows): keep platform module declarations grouped

---------

Co-authored-by: zipg <4047349+zipg@users.noreply.github.com>
2026-10-23 01:10:48 +08:00
..