mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-12 15:51:10 +03:00
This reverts commit a6571e71e4.
This commit is contained in:
@@ -300,35 +300,14 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
{
|
||||
use crate::platform;
|
||||
if args[0] == "--update" {
|
||||
if args.len() > 1 && args[1].ends_with(".dmg") {
|
||||
// Version check is unnecessary unless downgrading to an older version
|
||||
// that lacks "update dmg" support. This is a special case since we cannot
|
||||
// detect the version before extracting the DMG, so we skip the check.
|
||||
let dmg_path = &args[1];
|
||||
println!("Updating from DMG: {}", dmg_path);
|
||||
match platform::update_from_dmg(dmg_path) {
|
||||
Ok(_) => {
|
||||
println!("Update process from DMG started successfully.");
|
||||
// The new process will handle the rest. We can exit.
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Failed to start update from DMG: {}", err);
|
||||
}
|
||||
let _text = match platform::update_me() {
|
||||
Ok(_) => {
|
||||
log::info!("{}", translate("Update successfully!".to_string()));
|
||||
}
|
||||
} else {
|
||||
println!("Starting update process...");
|
||||
log::info!("Starting update process...");
|
||||
let _text = match platform::update_me() {
|
||||
Ok(_) => {
|
||||
println!("{}", translate("Update successfully!".to_string()));
|
||||
log::info!("Update successfully!");
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Update failed with error: {}", err);
|
||||
log::error!("Update failed with error: {err}");
|
||||
}
|
||||
};
|
||||
}
|
||||
Err(err) => {
|
||||
log::error!("Update failed with error: {err}");
|
||||
}
|
||||
};
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user