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:
javis-bot
2026-11-14 11:52:49 +09:00
parent b4ea9a6af4
commit 511791f39b
9 changed files with 599 additions and 7 deletions

View File

@@ -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> {