Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix(update): win aarch64 (#15389)

fufesou09bc9056c936
diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs
index becb6b037..9595ddd31 100644
--- a/src/flutter_ffi.rs
+++ b/src/flutter_ffi.rs
@@ -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")
diff --git a/src/platform/windows.rs b/src/platform/windows.rs
index 5c5c29211..5ced84e38 100644
--- a/src/platform/windows.rs
+++ b/src/platform/windows.rs
@@ -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
diff --git a/src/updater.rs b/src/updater.rs
index 357f111a7..56fdc1d2a 100644
--- a/src/updater.rs
+++ b/src/updater.rs
@@ -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 {