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")]