From 8f5ad1ac697e7931dbc3ddeac934ea1fc8293b34 Mon Sep 17 00:00:00 2001 From: anders_k Date: Tue, 11 May 2021 19:14:08 +0000 Subject: [PATCH] Abort if adding plug-in to installer fails (Bug #1264, part 2) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7267 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index c9eb32e9..8c45a7f0 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -5123,7 +5123,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) // Add the DLL to the installer if (data_handle == -1) { - int files_added; + int files_added=0; const int old_build_allowskipfiles=build_allowskipfiles; build_allowskipfiles=1; // on const int old_build_overwrite=build_overwrite; @@ -5136,8 +5136,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) // because of CEXEBuild::datablock_optimize() that tries to discover // duplicates and reuse them. ret=do_add_file(dllPath.c_str(),0,0,&files_added,tempDLL,2,&data_handle); // 2 means no size add - if (ret != PS_OK) { - return ret; + if (ret != PS_OK || files_added == 0) { + return files_added ? ret : PS_ERROR; } m_pPlugins->SetDllDataHandle(!!uninstall_mode, command, data_handle); build_overwrite=old_build_overwrite;