From 5998a90f3f0dda124eff1ce3c59e96d329e8b435 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Mon, 8 Jul 2024 14:33:40 +0300 Subject: [PATCH 01/79] fix(bundler): update nsis_tauri_utils to 0.4.1 (#10184) --- .changes/nsis-run-progrma-space.md | 5 +++++ tooling/bundler/src/bundle/windows/nsis.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/nsis-run-progrma-space.md diff --git a/.changes/nsis-run-progrma-space.md b/.changes/nsis-run-progrma-space.md new file mode 100644 index 000000000..8c920d93a --- /dev/null +++ b/.changes/nsis-run-progrma-space.md @@ -0,0 +1,5 @@ +--- +'tauri-bundler': 'patch:bug' +--- + +Fix NSIS installer failing to launch apps that contain spaces after installation. diff --git a/tooling/bundler/src/bundle/windows/nsis.rs b/tooling/bundler/src/bundle/windows/nsis.rs index e0235b2b2..b84c9b3af 100644 --- a/tooling/bundler/src/bundle/windows/nsis.rs +++ b/tooling/bundler/src/bundle/windows/nsis.rs @@ -34,8 +34,8 @@ const NSIS_URL: &str = #[cfg(target_os = "windows")] const NSIS_SHA1: &str = "057e83c7d82462ec394af76c87d06733605543d4"; const NSIS_TAURI_UTILS_URL: &str = - "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.4.0/nsis_tauri_utils.dll"; -const NSIS_TAURI_UTILS_SHA1: &str = "E0FC0951DEB0E5E741DF10328F95C7D6678AD3AA"; + "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.4.1/nsis_tauri_utils.dll"; +const NSIS_TAURI_UTILS_SHA1: &str = "F99A50209A345185A84D34D0E5F66D04C75FF52F"; #[cfg(target_os = "windows")] const NSIS_REQUIRED_FILES: &[&str] = &[ From afb102c59ba0de27e330589269001e0d2a01576d Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 8 Jul 2024 20:24:55 +0800 Subject: [PATCH 02/79] fix(runtime-wry): window edge not working after setting resizable false and decorated false dynamically (#10211) * Fix window edge not working after setting resziable false and decorated false dynamically * Fix example don't go crazy on resize * cargo fmt --- .changes/resize-false-undecorated-edge.md | 5 + core/tauri-runtime-wry/src/lib.rs | 12 +- examples/api/src/views/Window.svelte | 150 ++++++++++++---------- 3 files changed, 97 insertions(+), 70 deletions(-) create mode 100644 .changes/resize-false-undecorated-edge.md diff --git a/.changes/resize-false-undecorated-edge.md b/.changes/resize-false-undecorated-edge.md new file mode 100644 index 000000000..b58d47007 --- /dev/null +++ b/.changes/resize-false-undecorated-edge.md @@ -0,0 +1,5 @@ +--- +"tauri-runtime-wry": "patch:bug" +--- + +Fix window edge not working after setting resizable false and decorated false dynamically diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index a4e4626c8..36c243113 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -2774,7 +2774,15 @@ fn handle_user_message( WindowMessage::RequestUserAttention(request_type) => { window.request_user_attention(request_type.map(|r| r.0)); } - WindowMessage::SetResizable(resizable) => window.set_resizable(resizable), + WindowMessage::SetResizable(resizable) => { + window.set_resizable(resizable); + #[cfg(windows)] + if !resizable { + undecorated_resizing::detach_resize_handler(window.hwnd()); + } else if !window.is_decorated() { + undecorated_resizing::attach_resize_handler(window.hwnd()); + } + } WindowMessage::SetMaximizable(maximizable) => window.set_maximizable(maximizable), WindowMessage::SetMinimizable(minimizable) => window.set_minimizable(minimizable), WindowMessage::SetClosable(closable) => window.set_closable(closable), @@ -2796,7 +2804,7 @@ fn handle_user_message( #[cfg(windows)] if decorations { undecorated_resizing::detach_resize_handler(window.hwnd()); - } else { + } else if window.is_resizable() { undecorated_resizing::attach_resize_handler(window.hwnd()); } } diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte index 28ed5c33a..0cbf04fab 100644 --- a/examples/api/src/views/Window.svelte +++ b/examples/api/src/views/Window.svelte @@ -238,6 +238,14 @@ mainEl.classList.add('dark:bg-darkPrimary') } + async function updatePosition() { + webviewMap[selectedWebview]?.setPosition(new PhysicalPosition(x, y)) + } + + async function updateSize() { + webviewMap[selectedWebview]?.setSize(new PhysicalSize(width, height)) + } + $: { webviewMap[selectedWebview] loadWindowPosition() @@ -256,9 +264,6 @@ $: webviewMap[selectedWebview]?.setContentProtected(contentProtected) $: webviewMap[selectedWebview]?.setFullscreen(fullscreen) - $: width && - height && - webviewMap[selectedWebview]?.setSize(new PhysicalSize(width, height)) $: minWidth && minHeight ? webviewMap[selectedWebview]?.setMinSize( new LogicalSize(minWidth, minHeight) @@ -269,9 +274,6 @@ new LogicalSize(maxWidth, maxHeight) ) : webviewMap[selectedWebview]?.setMaxSize(null) - $: x !== null && - y !== null && - webviewMap[selectedWebview]?.setPosition(new PhysicalPosition(x, y)) $: webviewMap[selectedWebview] ?.scaleFactor() .then((factor) => (scaleFactor = factor)) @@ -403,22 +405,46 @@
X - +
Y - +
Width - +
Height - +
@@ -445,70 +471,58 @@
-
-
-
-
- Inner Size -
- Width: {innerSize.width} - Height: {innerSize.height} -
-
-
- Outer Size -
- Width: {outerSize.width} - Height: {outerSize.height} -
+
+
+
Inner Size
+ Width: {innerSize.width} + Height: {innerSize.height}
-
-
-
- Inner Logical Size -
- Width: {innerSize.toLogical(scaleFactor).width} - Height: {innerSize.toLogical(scaleFactor).height} -
-
-
- Outer Logical Size -
- Width: {outerSize.toLogical(scaleFactor).width} - Height: {outerSize.toLogical(scaleFactor).height} -
+
+
Outer Size
+ Width: {outerSize.width} + Height: {outerSize.height}
-
-
-
- Inner Position -
- x: {innerPosition.x} - y: {innerPosition.y} -
-
-
- Outer Position -
- x: {outerPosition.x} - y: {outerPosition.y} +
+
+ Inner Logical Size
+ Width: {innerSize.toLogical(scaleFactor).width.toFixed(3)} + Height: {innerSize.toLogical(scaleFactor).height.toFixed(3)}
-
-
-
- Inner Logical Position -
- x: {innerPosition.toLogical(scaleFactor).x} - y: {innerPosition.toLogical(scaleFactor).y} +
+
+ Outer Logical Size
-
-
- Outer Logical Position -
- x: {outerPosition.toLogical(scaleFactor).x} - y: {outerPosition.toLogical(scaleFactor).y} + Width: {outerSize.toLogical(scaleFactor).width.toFixed(3)} + Height: {outerSize.toLogical(scaleFactor).height.toFixed(3)} +
+
+
+ Inner Position
+ x: {innerPosition.x} + y: {innerPosition.y} +
+
+
+ Outer Position +
+ x: {outerPosition.x} + y: {outerPosition.y} +
+
+
+ Inner Logical Position +
+ x: {innerPosition.toLogical(scaleFactor).x.toFixed(3)} + y: {innerPosition.toLogical(scaleFactor).y.toFixed(3)} +
+
+
+ Outer Logical Position +
+ x: {outerPosition.toLogical(scaleFactor).x.toFixed(3)} + y: {outerPosition.toLogical(scaleFactor).y.toFixed(3)}

From c734b9e3cd6e5a22dfd84ec8a779c2ee9591751b Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Mon, 8 Jul 2024 14:51:26 +0200 Subject: [PATCH 03/79] feat(bundler/windows): Update wix to fix vulnerabilities and add arm support (#9861) (#10072) Co-authored-by: Lucas Nogueira --- .changes/feat-wix-arm64.md | 6 ++++++ tooling/bundler/src/bundle/windows/msi.rs | 2 +- tooling/bundler/src/bundle/windows/msi/wix.rs | 7 +++++-- tooling/bundler/src/bundle/windows/templates/main.wxs | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .changes/feat-wix-arm64.md diff --git a/.changes/feat-wix-arm64.md b/.changes/feat-wix-arm64.md new file mode 100644 index 000000000..4571337f5 --- /dev/null +++ b/.changes/feat-wix-arm64.md @@ -0,0 +1,6 @@ +--- +"tauri-bundler": "patch:feat" +"tauri-cli": "patch:feat" +--- + +Upgraded the WiX version to 3.14 which fixes vulnerability issues and adds support for Arm targets. diff --git a/tooling/bundler/src/bundle/windows/msi.rs b/tooling/bundler/src/bundle/windows/msi.rs index b24bef152..ced704182 100644 --- a/tooling/bundler/src/bundle/windows/msi.rs +++ b/tooling/bundler/src/bundle/windows/msi.rs @@ -26,7 +26,7 @@ const WIX_REQUIRED_FILES: &[&str] = &[ /// Returns a vector of PathBuf that shows where the MSI was created. pub fn bundle_project(settings: &Settings, updater: bool) -> crate::Result> { let mut wix_path = dirs::cache_dir().unwrap(); - wix_path.push("tauri/WixTools"); + wix_path.push("tauri/WixTools314"); if !wix_path.exists() { wix::get_and_extract_wix(&wix_path)?; diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 52c8d137c..9a3e19543 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -31,8 +31,8 @@ use uuid::Uuid; // URLS for the WIX toolchain. Can be used for cross-platform compilation. pub const WIX_URL: &str = - "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip"; -pub const WIX_SHA256: &str = "2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e"; + "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip"; +pub const WIX_SHA256: &str = "6ac824e1642d6f7277d0ed7ea09411a508f6116ba6fae0aa5f2c7daa2ff43d31"; // For Cross Platform Compilation. @@ -182,6 +182,7 @@ fn app_installer_output_path( let arch = match settings.binary_arch() { "x86" => "x86", "x86_64" => "x64", + "aarch64" => "arm64", target => { return Err(crate::Error::ArchError(format!( "Unsupported architecture: {}", @@ -294,6 +295,7 @@ fn run_candle( let arch = match settings.binary_arch() { "x86_64" => "x64", "x86" => "x86", + "aarch64" => "arm64", target => { return Err(crate::Error::ArchError(format!( "unsupported target: {}", @@ -388,6 +390,7 @@ pub fn build_wix_app_installer( let arch = match settings.binary_arch() { "x86_64" => "x64", "x86" => "x86", + "aarch64" => "arm64", target => { return Err(crate::Error::ArchError(format!( "unsupported target: {}", diff --git a/tooling/bundler/src/bundle/windows/templates/main.wxs b/tooling/bundler/src/bundle/windows/templates/main.wxs index fbbc0d669..047b0926e 100644 --- a/tooling/bundler/src/bundle/windows/templates/main.wxs +++ b/tooling/bundler/src/bundle/windows/templates/main.wxs @@ -4,6 +4,9 @@ + + + From a4a72330812fd0711ea6c392d9e725f7ce52c91b Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:00:06 +0800 Subject: [PATCH 04/79] chore(example): refactor api example (#10228) --- examples/api/src/App.svelte | 18 +- examples/api/src/app.css | 9 + .../api/src/components/MenuBuilder.svelte | 2 +- .../api/src/components/MenuItemBuilder.svelte | 1 + examples/api/src/views/Menu.svelte | 8 +- examples/api/src/views/Tray.svelte | 4 +- examples/api/src/views/Welcome.svelte | 8 +- examples/api/src/views/Window.svelte | 318 +++++++++--------- examples/api/unocss.config.js | 3 +- 9 files changed, 193 insertions(+), 178 deletions(-) diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 3b077748b..7051680ec 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -210,7 +210,7 @@