mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-25 22:21:01 +03:00
feat: windows, custom client, update (#13687)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -187,7 +187,10 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
hbb_common::config::PeerConfig::preload_peers();
|
||||
{
|
||||
crate::platform::try_remove_temp_update_files();
|
||||
hbb_common::config::PeerConfig::preload_peers();
|
||||
}
|
||||
std::thread::spawn(move || crate::start_server(false, no_server));
|
||||
} else {
|
||||
#[cfg(windows)]
|
||||
@@ -202,17 +205,24 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
if config::is_disable_installation() {
|
||||
return None;
|
||||
}
|
||||
let res = platform::update_me(false);
|
||||
let text = match res {
|
||||
Ok(_) => translate("Update successfully!".to_string()),
|
||||
Err(err) => {
|
||||
log::error!("Failed with error: {err}");
|
||||
translate("Update failed!".to_string())
|
||||
|
||||
let text = match crate::platform::prepare_custom_client_update() {
|
||||
Err(e) => {
|
||||
log::error!("Error preparing custom client update: {}", e);
|
||||
"Update failed!".to_string()
|
||||
}
|
||||
Ok(false) => "Update failed!".to_string(),
|
||||
Ok(true) => match platform::update_me(false) {
|
||||
Ok(_) => "Update successfully!".to_string(),
|
||||
Err(err) => {
|
||||
log::error!("Failed with error: {err}");
|
||||
"Update failed!".to_string()
|
||||
}
|
||||
},
|
||||
};
|
||||
Toast::new(Toast::POWERSHELL_APP_ID)
|
||||
.title(&config::APP_NAME.read().unwrap())
|
||||
.text1(&text)
|
||||
.text1(&translate(text))
|
||||
.sound(Some(Sound::Default))
|
||||
.duration(Duration::Short)
|
||||
.show()
|
||||
|
||||
Reference in New Issue
Block a user