feat: add signed launcher updates with native lifecycle recovery

This commit is contained in:
Emil
2026-09-09 19:48:10 +03:00
parent 7c0eb20894
commit 1d08396b80
39 changed files with 2952 additions and 46 deletions
+11 -6
View File
@@ -1,6 +1,6 @@
use super::data_dir;
use crate::settings;
use tauri::AppHandle;
use crate::{operations::LauncherOperations, settings};
use tauri::{AppHandle, State};
#[tauri::command]
pub(crate) async fn load_settings(app: AppHandle) -> Result<settings::LauncherSettings, String> {
@@ -14,11 +14,16 @@ pub(crate) async fn load_settings(app: AppHandle) -> Result<settings::LauncherSe
#[tauri::command]
pub(crate) async fn save_settings(
app: AppHandle,
state: State<'_, LauncherOperations>,
settings: settings::LauncherSettings,
) -> Result<settings::LauncherSettings, String> {
let data_dir = data_dir(&app)?;
tauri::async_runtime::spawn_blocking(move || settings::save(&data_dir, settings))
.await
.map_err(|error| format!("Settings task failed: {error}"))?
.map_err(|error| error.to_string())
let lifecycle = crate::update_guard::begin_operation(&data_dir, &state)?;
tauri::async_runtime::spawn_blocking(move || {
let _lifecycle = lifecycle;
settings::save(&data_dir, settings)
})
.await
.map_err(|error| format!("Settings task failed: {error}"))?
.map_err(|error| error.to_string())
}