From 8a63489567b9fa86e404ad42b5b30c64361efe85 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 10 Jun 2022 16:40:16 -0300 Subject: [PATCH] fix(build): fixed Webview2 runtime path in development, closes #4308 --- .changes/fix-dev-webview2-fixed-runtime-path.md | 5 +++++ core/tauri-build/src/lib.rs | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changes/fix-dev-webview2-fixed-runtime-path.md diff --git a/.changes/fix-dev-webview2-fixed-runtime-path.md b/.changes/fix-dev-webview2-fixed-runtime-path.md new file mode 100644 index 000000000..560d926a4 --- /dev/null +++ b/.changes/fix-dev-webview2-fixed-runtime-path.md @@ -0,0 +1,5 @@ +--- +"tauri-build": patch +--- + +Copy `tauri.conf.json > tauri.bundle.windows.webview_fixed_runtime_path` as a resource to the target directory to fix development usage of a fixed Webview2 runtime path. diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index 56578113f..08800810e 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -270,6 +270,11 @@ pub fn try_build(attributes: Attributes) -> Result<()> { if let Some(tray) = config.tauri.system_tray { resources.push(tray.icon_path.display().to_string()); } + #[cfg(windows)] + if let Some(fixed_webview2_runtime_path) = &config.tauri.bundle.windows.webview_fixed_runtime_path + { + resources.push(fixed_webview2_runtime_path.display().to_string()); + } copy_resources(ResourcePaths::new(resources.as_slice(), true), target_dir)?; #[cfg(target_os = "macos")]