Skip to content

Commit af95fb6

Browse files
authored
fix: sign main binary after patching with bundle info (fix #13868) (#13870)
* fixed #13868 * add main binary singing only on windows * updated readme message
1 parent 65bb24b commit af95fb6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-bundler: "patch:bug"
3+
---
4+
5+
The bundler now signs the main binary after patching it for every package type on windows

crates/tauri-bundler/src/bundle.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
8484
if matches!(target_os, TargetPlatform::Windows) {
8585
if settings.can_sign() {
8686
for bin in settings.binaries() {
87+
if bin.main() {
88+
// we will sign the main binary after patching per "package type"
89+
continue;
90+
}
8791
let bin_path = settings.binary_path(bin);
8892
windows::sign::try_sign(&bin_path, settings)?;
8993
}
@@ -130,6 +134,12 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
130134
log::warn!("Failed to add bundler type to the binary: {e}. Updater plugin may not be able to update this package. This shouldn't normally happen, please report it to https://github.com/tauri-apps/tauri/issues");
131135
}
132136

137+
// sign main binary for every package type after patch
138+
if matches!(target_os, TargetPlatform::Windows) && settings.can_sign() {
139+
let bin_path = settings.binary_path(main_binary);
140+
windows::sign::try_sign(&bin_path, settings)?;
141+
}
142+
133143
let bundle_paths = match package_type {
134144
#[cfg(target_os = "macos")]
135145
PackageType::MacOsBundle => macos::app::bundle_project(settings)?,

0 commit comments

Comments
 (0)