From 12cdda13fbf7689c168f6940d6ead382cca7edb2 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 19 Apr 2026 16:27:20 -0700 Subject: [PATCH] Use new format for update --- src-tauri/src/lib.rs | 10 ++++++---- src-tauri/tauri.linux.conf.json | 2 +- src-tauri/tauri.macos.conf.json | 2 +- src-tauri/tauri.windows.conf.json | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index bf6b551..2174d8a 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -773,13 +773,15 @@ async fn update( app: tauri::AppHandle, window: tauri::WebviewWindow, ) -> tauri_plugin_updater::Result<()> { - let target = { + use tauri_plugin_os::arch; + + let plat = { #[cfg(target_os = "linux")] { if std::path::Path::new("/etc/debian_version").exists() { "linux-debian" } else if std::path::Path::new("/etc/redhat-release").exists() { - "linux-fedora" + "linux-redhat" } else { let mut new_url = window.url().unwrap(); new_url.set_path("/update/outdated"); @@ -789,13 +791,13 @@ async fn update( } #[cfg(not(target_os = "linux"))] { - tauri_plugin_updater::target().unwrap_or("unknown".to_string()) + platform() } }; if let Some(update) = app .updater_builder() - .target(target) + .target(format!("{}-{}", plat, arch())) .build()? .check() .await? diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 402ed92..3a7cedf 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -37,7 +37,7 @@ "updater": { "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERFODI3MTAwQkNBMjE4REEKUldUYUdLSzhBSEdDM3J0N1NvbENsdDQ3c3BOdWlFajErVnlLZitSc2l5WVI0VjQ1ZHNMWjYzaUwK", "endpoints": [ - "https://games.lncvrt.xyz/api/launcher/update?target={{target}}&arch={{arch}}¤tVersion={{current_version}}" + "https://games.lncvrt.xyz/api/launcher/update?target={{target}}¤tVersion={{current_version}}" ] } } diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index 0166442..620cd95 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -43,7 +43,7 @@ "updater": { "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERFODI3MTAwQkNBMjE4REEKUldUYUdLSzhBSEdDM3J0N1NvbENsdDQ3c3BOdWlFajErVnlLZitSc2l5WVI0VjQ1ZHNMWjYzaUwK", "endpoints": [ - "https://games.lncvrt.xyz/api/launcher/update?target={{target}}&arch={{arch}}¤tVersion={{current_version}}" + "https://games.lncvrt.xyz/api/launcher/update?target={{target}}¤tVersion={{current_version}}" ] } } diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 4d2ca66..8ca8894 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -40,7 +40,7 @@ "updater": { "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERFODI3MTAwQkNBMjE4REEKUldUYUdLSzhBSEdDM3J0N1NvbENsdDQ3c3BOdWlFajErVnlLZitSc2l5WVI0VjQ1ZHNMWjYzaUwK", "endpoints": [ - "https://games.lncvrt.xyz/api/launcher/update?target={{target}}&arch={{arch}}¤tVersion={{current_version}}" + "https://games.lncvrt.xyz/api/launcher/update?target={{target}}¤tVersion={{current_version}}" ] } }