diff --git a/.changes/windows_arm_signtool_detect.md b/.changes/windows_arm_signtool_detect.md new file mode 100644 index 000000000000..afff5dc2b395 --- /dev/null +++ b/.changes/windows_arm_signtool_detect.md @@ -0,0 +1,17 @@ +--- +"tauri-bundler": patch:enhance +--- + +Signtool path for windows arm systems was not being properly returned which caused failure in signing of windows binaries. + +This patch addresses it. + +Previously only the following were supported: + +- PROCESSOR_ARCHITECTURE_INTEL +- PROCESSOR_ARCHITECTURE_AMD64 + +The following were added: + +- PROCESSOR_ARCHITECTURE_ARM +- PROCESSOR_ARCHITECTURE_ARM64 diff --git a/crates/tauri-bundler/src/bundle/windows/sign.rs b/crates/tauri-bundler/src/bundle/windows/sign.rs index f7c7ad1e2122..d9922f58ff69 100644 --- a/crates/tauri-bundler/src/bundle/windows/sign.rs +++ b/crates/tauri-bundler/src/bundle/windows/sign.rs @@ -97,7 +97,7 @@ fn signtool() -> Option { kit_bin_paths.push(kits_root_10_bin_path); // Choose which version of SignTool to use based on OS bitness - let arch_dir = util::os_bitness().ok_or(crate::Error::UnsupportedBitness)?; + let arch_dir = util::processor_architecture().ok_or(crate::Error::UnsupportedBitness)?; /* Iterate through all bin paths, checking for existence of a SignTool executable. */ for kit_bin_path in &kit_bin_paths { diff --git a/crates/tauri-bundler/src/bundle/windows/util.rs b/crates/tauri-bundler/src/bundle/windows/util.rs index 55cfea3a968f..e716ad7bbef5 100644 --- a/crates/tauri-bundler/src/bundle/windows/util.rs +++ b/crates/tauri-bundler/src/bundle/windows/util.rs @@ -64,9 +64,10 @@ pub fn download_webview2_offline_installer(base_path: &Path, arch: &str) -> crat } #[cfg(target_os = "windows")] -pub fn os_bitness<'a>() -> Option<&'a str> { +pub fn processor_architecture<'a>() -> Option<&'a str> { use windows_sys::Win32::System::SystemInformation::{ - GetNativeSystemInfo, PROCESSOR_ARCHITECTURE_AMD64, PROCESSOR_ARCHITECTURE_INTEL, SYSTEM_INFO, + GetNativeSystemInfo, PROCESSOR_ARCHITECTURE_AMD64, PROCESSOR_ARCHITECTURE_ARM, + PROCESSOR_ARCHITECTURE_ARM64, PROCESSOR_ARCHITECTURE_INTEL, SYSTEM_INFO, }; let mut system_info: SYSTEM_INFO = unsafe { std::mem::zeroed() }; @@ -74,6 +75,8 @@ pub fn os_bitness<'a>() -> Option<&'a str> { match unsafe { system_info.Anonymous.Anonymous.wProcessorArchitecture } { PROCESSOR_ARCHITECTURE_INTEL => Some("x86"), PROCESSOR_ARCHITECTURE_AMD64 => Some("x64"), + PROCESSOR_ARCHITECTURE_ARM => Some("arm"), + PROCESSOR_ARCHITECTURE_ARM64 => Some("arm64"), _ => None, } }