From fde145f071ff888ca89781a314a70b37f818b050 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 19 Apr 2026 12:54:00 -0700 Subject: [PATCH] Remove updater --- src-tauri/Cargo.toml | 1 - src-tauri/capabilities/desktop.json | 17 ++----- src-tauri/src/lib.rs | 78 ----------------------------- src-tauri/tauri.linux.conf.json | 2 +- src-tauri/tauri.macos.conf.json | 2 +- src-tauri/tauri.windows.conf.json | 2 +- src/app/update/checking/page.tsx | 5 -- src/app/update/layout.tsx | 42 ---------------- src/app/update/outdated/page.tsx | 20 -------- src/app/update/updating/page.tsx | 5 -- 10 files changed, 7 insertions(+), 167 deletions(-) delete mode 100644 src/app/update/checking/page.tsx delete mode 100644 src/app/update/layout.tsx delete mode 100644 src/app/update/outdated/page.tsx delete mode 100644 src/app/update/updating/page.tsx diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 2053b3b..1f9d27e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -44,7 +44,6 @@ sysinfo = "0.38.4" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-single-instance = "2.4.1" -tauri-plugin-updater = "2.10.1" tauri-plugin-window-state = "2.4.1" [target.'cfg(target_os = "windows")'.dependencies] diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json index a46b36a..f98a75f 100644 --- a/src-tauri/capabilities/desktop.json +++ b/src-tauri/capabilities/desktop.json @@ -1,15 +1,6 @@ { "identifier": "desktop-capability", - "platforms": [ - "macOS", - "windows", - "linux" - ], - "windows": [ - "main" - ], - "permissions": [ - "window-state:default", - "updater:default" - ] -} \ No newline at end of file + "platforms": ["macOS", "windows", "linux"], + "windows": ["main"], + "permissions": ["window-state:default"] +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 2cf79a2..e8c9084 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -32,9 +32,6 @@ use sysinfo::System; #[cfg(unix)] use std::os::unix::fs::PermissionsExt; -#[cfg(not(debug_assertions))] -use tauri_plugin_updater::UpdaterExt; - struct AppState { custom_data_dir: RwLock>, } @@ -685,7 +682,6 @@ fn open_new_window( pub fn run() { #[allow(unused_variables)] tauri::Builder::default() - .plugin(tauri_plugin_updater::Builder::new().build()) .plugin(tauri_plugin_store::Builder::new().build()) .plugin(tauri_plugin_http::init()) .plugin( @@ -762,83 +758,9 @@ pub fn run() { eprintln!("Failed to create overlay titlebar: {:?}", e); } } - #[cfg(not(debug_assertions))] - { - let handle = app.handle().clone(); - tauri::async_runtime::spawn(async move { - update(handle, window.clone()).await.unwrap(); - }); - } - #[cfg(debug_assertions)] - { - let mut new_url = app.config().build.dev_url.clone().unwrap(); - new_url.set_path("/main"); - window.navigate(new_url).unwrap(); - } Ok(()) }) .run(tauri::generate_context!()) .expect("error while running tauri application"); } - -#[cfg(not(debug_assertions))] -async fn update( - app: tauri::AppHandle, - window: tauri::WebviewWindow, -) -> tauri_plugin_updater::Result<()> { - let target = { - #[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" - } else { - let mut new_url = window.url().unwrap(); - new_url.set_path("/update/outdated"); - window.navigate(new_url).unwrap(); - return Ok(()); - } - } - #[cfg(not(target_os = "linux"))] - { - tauri_plugin_updater::target().unwrap_or("unknown".to_string()) - } - }; - - if let Some(update) = app - .updater_builder() - .target(target) - .build()? - .check() - .await? - { - let mut new_url = window.url().unwrap(); - new_url.set_path("/update/updating"); - window.navigate(new_url).unwrap(); - - let mut downloaded = 0; - - update - .download_and_install( - |chunk_length, content_length| { - downloaded += chunk_length; - println!("downloaded {downloaded} from {content_length:?}"); - }, - || { - println!("download finished"); - }, - ) - .await?; - - println!("update installed"); - app.restart(); - } - - let mut new_url = window.url().unwrap(); - new_url.set_path("/main"); - window.navigate(new_url).unwrap(); - - Ok(()) -} diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 0a8a972..36db18d 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -13,7 +13,7 @@ "windows": [ { "title": "Lncvrt Games Launcher", - "url": "/update/checking", + "url": "/main", "width": 1000, "height": 600, "minWidth": 1000, diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index 888ef0a..3524d9a 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -14,7 +14,7 @@ "windows": [ { "title": "Lncvrt Games Launcher", - "url": "/update/checking", + "url": "/main", "width": 1000, "height": 600, "minWidth": 1000, diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index da95f14..5c1a8c6 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -14,7 +14,7 @@ "windows": [ { "title": "Lncvrt Games Launcher", - "url": "/update/checking", + "url": "/main", "width": 1000, "height": 632, "minWidth": 1000, diff --git a/src/app/update/checking/page.tsx b/src/app/update/checking/page.tsx deleted file mode 100644 index 10d4cb7..0000000 --- a/src/app/update/checking/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -'use client' - -export default function UpdateCheckingPage () { - return

Checking for updates

-} diff --git a/src/app/update/layout.tsx b/src/app/update/layout.tsx deleted file mode 100644 index 4ac0db6..0000000 --- a/src/app/update/layout.tsx +++ /dev/null @@ -1,42 +0,0 @@ -'use client' - -import '@/styles/globals.css' -import { platform } from '@tauri-apps/plugin-os' -import { Roboto } from 'next/font/google' -import { useEffect, useState } from 'react' - -const roboto = Roboto({ - subsets: ['latin'] -}) - -export default function RootLayout ({ - children -}: { - children: React.ReactNode -}) { - const [platformName, setPlatformName] = useState(null) - - useEffect(() => { - setTimeout(() => setPlatformName(platform()), 0) - }, []) - - return ( - <> - - -