Skip to content

Commit b051f75

Browse files
committed
fix: sign nsis plugin DLLs
1 parent ff39ad9 commit b051f75

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.changes/nsis-sign-plugins.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-bundler': 'patch:enhance'
3+
---
4+
5+
Sign nsis plugin files when bundling

crates/tauri-bundler/src/bundle/windows/nsis/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ const NSIS_REQUIRED_FILES: &[&str] = &[
5151
"Include/nsDialogs.nsh",
5252
"Include/WinMessages.nsh",
5353
];
54+
#[cfg(target_os = "windows")]
55+
const NSIS_PLUGIN_FILES: &[&str] = &[
56+
"NSISdl.dll",
57+
"StartMenu.dll",
58+
"System.dll",
59+
"nsDialogs.dll",
60+
"nsis_tauri_utils.dll",
61+
];
62+
#[cfg(not(target_os = "windows"))]
63+
const NSIS_PLUGIN_FILES: &[&str] = &[];
5464
#[cfg(not(target_os = "windows"))]
5565
const NSIS_REQUIRED_FILES: &[&str] = &["Plugins/x86-unicode/nsis_tauri_utils.dll"];
5666

@@ -517,6 +527,14 @@ fn build_nsis_app_installer(
517527
));
518528
fs::create_dir_all(nsis_installer_path.parent().unwrap())?;
519529

530+
if settings.can_sign() {
531+
log::info!("Signing NSIS plugins");
532+
for dll in NSIS_PLUGIN_FILES {
533+
let path = _nsis_toolset_path.join("Plugins/x86-unicode").join(dll);
534+
try_sign(&path, settings)?;
535+
}
536+
}
537+
520538
log::info!(action = "Running"; "makensis.exe to produce {}", display_path(&nsis_installer_path));
521539

522540
#[cfg(target_os = "windows")]

0 commit comments

Comments
 (0)