fix: sign nsis plugin DLLs

This commit is contained in:
thewh1teagle 2024-11-13 15:36:42 +02:00
parent ff39ad93b7
commit 9e3ac6e311
No known key found for this signature in database
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
'tauri-bundler': 'patch:enhance'
---
Sign nsis plugin files when bundling

View File

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