fix: update macos (#12578)

* fix: update macos

1. Use `ditto` instead of `cp -r`.
2. Add prompt for extracting dmg.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: error to err

Signed-off-by: fufesou <linlong1266@gmail.com>

* Refact: Remove "Extracting"

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
fufesou
2025-08-07 23:31:31 +08:00
committed by GitHub
parent e85989e9d9
commit 39b91911cb
4 changed files with 96 additions and 30 deletions

View File

@@ -629,7 +629,10 @@ pub fn session_open_terminal(session_id: SessionID, terminal_id: i32, rows: u32,
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.open_terminal(terminal_id, rows, cols);
} else {
log::error!("[flutter_ffi] Session not found for session_id: {}", session_id);
log::error!(
"[flutter_ffi] Session not found for session_id: {}",
session_id
);
}
}
@@ -2651,6 +2654,21 @@ pub fn main_set_common(_key: String, _value: String) {
fs::remove_file(f).ok();
}
}
} else if _key == "extract-update-dmg" {
#[cfg(target_os = "macos")]
{
if let Some(new_version_file) = get_download_file_from_url(&_value) {
if let Some(f) = new_version_file.to_str() {
crate::platform::macos::extract_update_dmg(f);
} else {
// unreachable!()
log::error!("Failed to get the new version file path");
}
} else {
// unreachable!()
log::error!("Failed to get the new version file from url: {}", _value);
}
}
}
}