Skip to content

Commit 1035f12

Browse files
authored
fix(windows): tauri-bundler detect arm system (#14923)
* detect arm systems in windows - Arm system were not detected when running signtool causing bundle failures when signing windows binaries
1 parent 04f7048 commit 1035f12

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"tauri-bundler": patch:enhance
3+
---
4+
5+
Signtool path for windows arm systems was not being properly returned which caused failure in signing of windows binaries.
6+
7+
This patch addresses it.
8+
9+
Previously only the following were supported:
10+
11+
- PROCESSOR_ARCHITECTURE_INTEL
12+
- PROCESSOR_ARCHITECTURE_AMD64
13+
14+
The following were added:
15+
16+
- PROCESSOR_ARCHITECTURE_ARM
17+
- PROCESSOR_ARCHITECTURE_ARM64

crates/tauri-bundler/src/bundle/windows/sign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn signtool() -> Option<PathBuf> {
9797
kit_bin_paths.push(kits_root_10_bin_path);
9898

9999
// Choose which version of SignTool to use based on OS bitness
100-
let arch_dir = util::os_bitness().ok_or(crate::Error::UnsupportedBitness)?;
100+
let arch_dir = util::processor_architecture().ok_or(crate::Error::UnsupportedBitness)?;
101101

102102
/* Iterate through all bin paths, checking for existence of a SignTool executable. */
103103
for kit_bin_path in &kit_bin_paths {

crates/tauri-bundler/src/bundle/windows/util.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,19 @@ pub fn download_webview2_offline_installer(base_path: &Path, arch: &str) -> crat
6464
}
6565

6666
#[cfg(target_os = "windows")]
67-
pub fn os_bitness<'a>() -> Option<&'a str> {
67+
pub fn processor_architecture<'a>() -> Option<&'a str> {
6868
use windows_sys::Win32::System::SystemInformation::{
69-
GetNativeSystemInfo, PROCESSOR_ARCHITECTURE_AMD64, PROCESSOR_ARCHITECTURE_INTEL, SYSTEM_INFO,
69+
GetNativeSystemInfo, PROCESSOR_ARCHITECTURE_AMD64, PROCESSOR_ARCHITECTURE_ARM,
70+
PROCESSOR_ARCHITECTURE_ARM64, PROCESSOR_ARCHITECTURE_INTEL, SYSTEM_INFO,
7071
};
7172

7273
let mut system_info: SYSTEM_INFO = unsafe { std::mem::zeroed() };
7374
unsafe { GetNativeSystemInfo(&mut system_info) };
7475
match unsafe { system_info.Anonymous.Anonymous.wProcessorArchitecture } {
7576
PROCESSOR_ARCHITECTURE_INTEL => Some("x86"),
7677
PROCESSOR_ARCHITECTURE_AMD64 => Some("x64"),
78+
PROCESSOR_ARCHITECTURE_ARM => Some("arm"),
79+
PROCESSOR_ARCHITECTURE_ARM64 => Some("arm64"),
7780
_ => None,
7881
}
7982
}

0 commit comments

Comments
 (0)