I want to deploy a DLL plugin that is used by a third party commercial software. Mulitple versions of the plugin can exist in the same directory, and the commercial software chooses which one to install and load. The repository looks like this:
./Plugins/
GeneratedVersionName1/
Dependency1/
Dependency2/
GeneratedVersionName2/
Dependency3/
Before building the Plugin, I have to specify a custom path for the SetDllDirectoryA() function pointing to the root folder where the dependency of the plugin lays, otherwise the plugin won't be able to find its dependencies. For example, I have to know the path Plugins/GeneratedVersionName1 at compile time, otherwise I won't be able to have a correct path passed to SetDll.. Knowing that GeneratedVersionName1 is generated after the build is finished.
What are the best practices for managing multiversion plugins and their dependencies for cases like this? Thanks