Add a way to bypass update checking

This commit is contained in:
Lncvrt committed 2026-04-26 17:53:18 -07:00
1 parent 2955c5d3f9
commit bec02b1578
7 files changed
+58 -6

No files matched your search

+1
View File
@@ -46,6 +46,7 @@ tauri-plugin-single-instance = "2.4.1"
tauri-plugin-updater = "2.10.1"
tauri-plugin-window-state = "2.4.1"
tauri-plugin-process = "2.3.1"
tauri-plugin-cli = "2.4.1"
[target.'cfg(target_os = "windows")'.dependencies]
tauri-plugin-decorum = "1.1.1"
+23 -6
View File
@@ -690,6 +690,7 @@ fn open_new_window(
pub fn run() {
#[allow(unused)]
let mut builder = tauri::Builder::default()
.plugin(tauri_plugin_cli::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_store::Builder::new().build())
@@ -750,16 +751,32 @@ pub fn run() {
}
#[cfg(not(debug_assertions))]
{
let handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
update(handle, window.clone()).await.unwrap();
});
use tauri_plugin_cli::CliExt;
match app.cli().matches() {
Ok(matches) => match matches.args.get("no-check-updates") {
Some(arg) => {
if arg.value == false {
let handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
update(handle, window.clone()).await.unwrap();
});
} else {
let mut new_url = window.url().unwrap();
new_url.set_path("/main");
let _ = window.navigate(new_url);
}
}
None => {}
},
Err(_) => {}
}
}
#[cfg(debug_assertions)]
{
let mut new_url = app.config().build.dev_url.clone().unwrap();
let mut new_url = window.url().unwrap();
new_url.set_path("/main");
window.navigate(new_url).unwrap();
let _ = window.navigate(new_url).unwrap();
}
Ok(())
+10
View File
@@ -39,6 +39,16 @@
"endpoints": [
"https://games.lncvrt.xyz/api/launcher/update?target={{target}}&currentVersion={{current_version}}"
]
},
"cli": {
"description": "Lncvrt Games Launcher CLI",
"args": [
{
"short": "n",
"name": "no-check-updates",
"description": "Bypasses th eupdate checker"
}
]
}
}
}
+10
View File
@@ -45,6 +45,16 @@
"endpoints": [
"https://games.lncvrt.xyz/api/launcher/update?target={{target}}&currentVersion={{current_version}}"
]
},
"cli": {
"description": "Lncvrt Games Launcher CLI",
"args": [
{
"short": "n",
"name": "no-check-updates",
"description": "Bypasses th eupdate checker"
}
]
}
}
}
+10
View File
@@ -42,6 +42,16 @@
"endpoints": [
"https://games.lncvrt.xyz/api/launcher/update?target={{target}}&currentVersion={{current_version}}"
]
},
"cli": {
"description": "Lncvrt Games Launcher CLI",
"args": [
{
"short": "n",
"name": "no-check-updates",
"description": "Bypasses th eupdate checker"
}
]
}
}
}