feat: add architecture check for GUI updater

Return early if target architecture is not x86_64 or aarch64
This commit is contained in:
Pluto Yang committed 2026-04-14 16:22:48 +08:00
1 parent bd613382bc
commit 48d96dbb9d
1 file changed
+9 -4
+9 -4
View File
@@ -88,6 +88,10 @@ impl GuiUpdater {
}
pub async fn update(&self) {
if !cfg!(any(target_arch = "x86_64", target_arch = "aarch64")) {
info!("GUI version is not supported on this architecture.");
return;
}
info!("Update GUI, version: {}", self.version);
#[cfg(debug_assertions)]
@@ -99,10 +103,11 @@ impl GuiUpdater {
format!("v{}", self.version)
};
#[cfg(target_arch = "x86_64")]
let arch = "x86_64";
#[cfg(target_arch = "aarch64")]
let arch = "aarch64";
let arch = if cfg!(target_arch = "x86_64") {
"x86_64"
} else {
"aarch64"
};
let file_url = format!(
"https://github.com/yuezk/GlobalProtect-openconnect/releases/download/{}/gpgui_{}.bin.tar.xz",