From c868893f30d8eb9d590d705a63fc7b8b763f2f5e Mon Sep 17 00:00:00 2001 From: skylartaylor Date: Thu, 22 Oct 2026 15:58:28 +0200 Subject: [PATCH] fix: validate the portable launcher before committing its update --- crates/native/src/portable.rs | 68 ++++++++++++++++++++++++++------ crates/native/src/self_update.rs | 67 +++++++++++++++++++++++++------ 2 files changed, 109 insertions(+), 26 deletions(-) diff --git a/crates/native/src/portable.rs b/crates/native/src/portable.rs index ba6c1a31..04ca2322 100644 --- a/crates/native/src/portable.rs +++ b/crates/native/src/portable.rs @@ -306,11 +306,11 @@ pub fn remove(app: &CraftApp, record: &Record) -> Result<(), String> { /// Unpacks the launcher's own portable zip into `staging`, with the same checks as an app's, and /// copies it over `folder` for a self-update. `check` must accept every unpacked file before -/// any is copied. When every file sits in one top-level folder, that folder's contents are the -/// program. A copy that fails puts the previous files back. When one of them can't be put back, +/// any is copied, and again before the backup is removed. The archive must include `executable`. +/// When every file sits in one top-level folder, that folder's contents are the program. A copy that fails puts the previous files back. When one of them can't be put back, /// the previous files move to a `-recovery-