diff --git a/Source/Plugins.cpp b/Source/Plugins.cpp index 3a4c0f10..d029c365 100644 --- a/Source/Plugins.cpp +++ b/Source/Plugins.cpp @@ -233,6 +233,14 @@ bool Plugins::Initialize(const TCHAR*arcsubdir, bool displayInfo) return true; } +bool Plugins::FindDllPath(const tstring filename, tstring&dllPath) +{ + tstring dllName = remove_file_extension(filename); + if (!contains(m_dllname_to_path, dllName)) return false; + dllPath = get_paired_value(m_dllname_to_path, dllName); + return true; +} + bool Plugins::GetCommandInfo(const tstring&command, tstring&canoniccmd, tstring&dllPath) { const tstring dllname = GetDllName(command); diff --git a/Source/Plugins.h b/Source/Plugins.h index 816b9397..7dc3d097 100644 --- a/Source/Plugins.h +++ b/Source/Plugins.h @@ -50,6 +50,7 @@ class Plugins bool Initialize(const TCHAR*arcsubdir, bool displayInfo); void AddPluginsDir(const tstring& path, bool displayInfo); + bool FindDllPath(const tstring filename, tstring&dllPath); bool IsPluginCommand(const tstring& command) const; bool IsKnownPlugin(const tstring& token) const; bool GetCommandInfo(const tstring&command, tstring&canoniccmd, tstring&dllPath); diff --git a/Source/script.cpp b/Source/script.cpp index edc02c1b..b7af3acf 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -4765,10 +4765,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) tstring pluginfullpath; if (reserveplugin && get_file_name(t)==t) { - pluginfullpath = definedlist.find(_T("NSISDIR")); - pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + _T("Plugins"); - pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + get_target_suffix(); - pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + t; + if (!m_pPlugins || !m_pPlugins->FindDllPath(t, pluginfullpath)) + { + pluginfullpath = definedlist.find(_T("NSISDIR")); + pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + _T("Plugins"); + pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + get_target_suffix(); + pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + t; + } t = (TCHAR*) pluginfullpath.c_str(); } int tf=0; @@ -6095,7 +6098,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) if (comma++) es += _T(", /"); es += ts; } - ERROR_MSG(_T("Error: %") NPRIs _T("\n"),es.c_str()); + ERROR_MSG(_T("Error: %") NPRIs _T("\n"), es.c_str()); return PS_ERROR; } }