fix(update): win aarch64 (#15389)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2026-06-23 17:59:29 +08:00
committed by GitHub
parent 0c6df924d1
commit 09bc9056c9
3 changed files with 26 additions and 3 deletions

View File

@@ -2852,8 +2852,16 @@ pub fn main_get_common(key: String) -> String {
crate::platform::windows::is_msi_installed(),
crate::common::is_custom_client(),
) {
(Ok(true), false) => format!("rustdesk-{_version}-x86_64.msi"),
(Ok(true), true) | (Ok(false), _) => format!("rustdesk-{_version}-x86_64.exe"),
(Ok(true), false) => match crate::platform::windows::release_arch_suffix() {
Some(arch) => format!("rustdesk-{_version}-{arch}.msi"),
None => "error:unsupported".to_owned(),
},
(Ok(true), true) | (Ok(false), _) => {
match crate::platform::windows::release_arch_suffix() {
Some(arch) => format!("rustdesk-{_version}-{arch}.exe"),
None => "error:unsupported".to_owned(),
}
}
(Err(e), _) => {
log::error!("Failed to check if is msi: {}", e);
format!("error:update-failed-check-msi-tip")

View File

@@ -3944,6 +3944,14 @@ pub fn is_x64() -> bool {
unsafe { sys_info.u.s().wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 }
}
pub fn release_arch_suffix() -> Option<&'static str> {
match std::env::consts::ARCH {
"x86_64" => Some("x86_64"),
"aarch64" => Some("aarch64"),
_ => None,
}
}
pub fn try_kill_rustdesk_main_window_process() -> ResultType<()> {
// Kill rustdesk.exe without extra arg, should only be called by --server
// We can find the exact process which occupies the ipc, see more from https://github.com/winsiderss/systeminformer

View File

@@ -136,10 +136,17 @@ fn check_update(manually: bool) -> ResultType<()> {
let version = download_url.split('/').last().unwrap_or_default();
#[cfg(target_os = "windows")]
let download_url = if cfg!(feature = "flutter") {
let Some(arch) = crate::platform::windows::release_arch_suffix() else {
bail!(
"Unsupported Windows release architecture: {}",
std::env::consts::ARCH
);
};
format!(
"{}/rustdesk-{}-x86_64.{}",
"{}/rustdesk-{}-{}.{}",
download_url,
version,
arch,
if update_msi { "msi" } else { "exe" }
)
} else {