diff --git a/.changes/tauri-build-copy-webview2-runtime.md b/.changes/tauri-build-copy-webview2-runtime.md new file mode 100644 index 000000000..5ab5a117c --- /dev/null +++ b/.changes/tauri-build-copy-webview2-runtime.md @@ -0,0 +1,5 @@ +--- +'tauri-build': 'patch:bug' +--- + +Correctly copy the WebView2 runtime in development when `webviewInstallMode` is used instead of `webviewFixedRuntimePath`. diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index 231f7d649..dc1c787b6 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -9,7 +9,7 @@ use cargo_toml::Manifest; use heck::AsShoutySnakeCase; use tauri_utils::{ - config::Config, + config::{Config, WebviewInstallMode}, resources::{external_binaries, resource_relpath, ResourcePaths}, }; @@ -347,7 +347,13 @@ pub fn try_build(attributes: Attributes) -> Result<()> { let mut resources = config.tauri.bundle.resources.clone().unwrap_or_default(); if target_triple.contains("windows") { if let Some(fixed_webview2_runtime_path) = - &config.tauri.bundle.windows.webview_fixed_runtime_path + match &config.tauri.bundle.windows.webview_fixed_runtime_path { + Some(path) => Some(path), + None => match &config.tauri.bundle.windows.webview_install_mode { + WebviewInstallMode::FixedRuntime { path } => Some(path), + _ => None, + }, + } { resources.push(fixed_webview2_runtime_path.display().to_string()); }