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 13, 2024
1 parent ff39ad9 commit 07f64cf
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 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,14 @@ const NSIS_REQUIRED_FILES: &[&str] = &[
"Include/nsDialogs.nsh",
"Include/WinMessages.nsh",
];
#[cfg(target_os = "windows")]
const NSIS_PLUGIN_DLLS: &[&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"];

Expand Down Expand Up @@ -517,6 +525,29 @@ fn build_nsis_app_installer(
));
fs::create_dir_all(nsis_installer_path.parent().unwrap())?;

#[cfg(target_os = "windows")]
if settings.can_sign() {
log::info!("Signing NSIS plugins");
for dll in glob::glob(
_nsis_toolset_path
.join("Plugins/*/*.dll")
.to_string_lossy()
.to_string()
.as_str(),
)? {
let path = dll?;
if NSIS_PLUGIN_DLLS.contains(
&path
.file_name()
.unwrap_or_default()
.to_string_lossy()
.as_ref(),
) {
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 07f64cf

Please sign in to comment.