Skip to content

Commit

Permalink
fix: sign nsis plugin DLLs
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Nov 14, 2024
1 parent ff39ad9 commit b051f75
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/nsis-sign-plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-bundler': 'patch:enhance'
---

Sign nsis plugin files when bundling
18 changes: 18 additions & 0 deletions crates/tauri-bundler/src/bundle/windows/nsis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ const NSIS_REQUIRED_FILES: &[&str] = &[
"Include/nsDialogs.nsh",
"Include/WinMessages.nsh",
];
#[cfg(target_os = "windows")]
const NSIS_PLUGIN_FILES: &[&str] = &[
"NSISdl.dll",
"StartMenu.dll",
"System.dll",
"nsDialogs.dll",
"nsis_tauri_utils.dll",
];
#[cfg(not(target_os = "windows"))]
const NSIS_PLUGIN_FILES: &[&str] = &[];
#[cfg(not(target_os = "windows"))]
const NSIS_REQUIRED_FILES: &[&str] = &["Plugins/x86-unicode/nsis_tauri_utils.dll"];

Expand Down Expand Up @@ -517,6 +527,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")]
Expand Down

0 comments on commit b051f75

Please sign in to comment.