feat(app): update the app from the project's Gitea releases
- update.rs finds the newest app-v<version> release above the running version (v1 tags, drafts, prereleases, incomplete releases and files on another server are skipped), downloads Jarvis-Setup-<version>.exe into cache/updates checked against its .sha256, and hands it over. - update_install hashes the file again, stops what runs, starts the installer with /S /RUN as administrator and the window quits; a declined administrator prompt keeps the app with the services stopped. - New 업데이트 screen; the app checks once when the main screens open. - tauri.conf.json no longer sets its own version, so the program file carries the Cargo.toml version the update compares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,8 +27,14 @@ struct Api {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn admin(state: tauri::State<'_, Api>, command: String, args: Option<Value>) -> Result<Value, String> {
|
||||
state.api.call(&command, args.unwrap_or(Value::Null)).await
|
||||
async fn admin(app: tauri::AppHandle, state: tauri::State<'_, Api>, command: String, args: Option<Value>) -> Result<Value, String> {
|
||||
let out = state.api.call(&command, args.unwrap_or(Value::Null)).await?;
|
||||
// An update's installer was started (what ran is stopped): quit so it can replace the app.
|
||||
if out["exit"] == Value::Bool(true) {
|
||||
state.phase.store(CLOSING, Ordering::SeqCst);
|
||||
app.exit(0);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
fn arg(name: &str) -> Option<String> {
|
||||
|
||||
Reference in New Issue
Block a user