From 9e3ac6e3119a00ad6a34f080b57d106d96d43c32 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:36:42 +0200 Subject: [PATCH] fix: sign nsis plugin DLLs --- .changes/nsis-sign-plugins.md | 5 +++++ .../tauri-bundler/src/bundle/windows/nsis/mod.rs | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .changes/nsis-sign-plugins.md diff --git a/.changes/nsis-sign-plugins.md b/.changes/nsis-sign-plugins.md new file mode 100644 index 000000000000..1109dd6ab3c5 --- /dev/null +++ b/.changes/nsis-sign-plugins.md @@ -0,0 +1,5 @@ +--- +'tauri-bundler': 'patch:enhance' +--- + +Sign nsis plugin files when bundling \ No newline at end of file diff --git a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs index 810141214c5c..52db13ad781c 100644 --- a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs @@ -51,6 +51,13 @@ const NSIS_REQUIRED_FILES: &[&str] = &[ "Include/nsDialogs.nsh", "Include/WinMessages.nsh", ]; +const NSIS_PLUGIN_FILES: &[&str] = &[ + "NSISdl.dll", + "StartMenu.dll", + "System.dll", + "nsDialogs.dll", + "nsis_tauri_utils.dll", +]; #[cfg(not(target_os = "windows"))] const NSIS_REQUIRED_FILES: &[&str] = &["Plugins/x86-unicode/nsis_tauri_utils.dll"]; @@ -517,6 +524,14 @@ fn build_nsis_app_installer( )); fs::create_dir_all(nsis_installer_path.parent().unwrap())?; + if settings.can_sign() { + log::info!("Signing NSIS plugins"); + for dll in NSIS_PLUGIN_FILES { + let path = _nsis_toolset_path.join("Plugins/x86-unicode").join(dll); + try_sign(&path, settings)?; + } + } + log::info!(action = "Running"; "makensis.exe to produce {}", display_path(&nsis_installer_path)); #[cfg(target_os = "windows")]