Hi,
to start with: here is a link to Microsoft's description on the search order for loading DLL's:
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order?redirectedfrom...
This might be helpful as background information.
By reading your description, I guess the program we are looking at is a command line executable (rather than an Alias plug-in), right? If that's correct, please refer to section "Standard Search Order for Desktop Applications" in that linked page.
The bottom line in your case basically is:
If an Alias version older than 2021.3 is been installed after Alias 2021.3 has been, then the substring "<Older Alias Installation Path>/bin" is been added to the PATH environment variable before the occurrence of substring "<Alias 2021.3 installation path>/bin". Consequently, libalias_api.dll is been found in "<Older Alias Installation Path>/bin" (as directories listed in PATH are searched from the beginning to the end).
Unfortunately, there is no "one size fits all" solution for that "DLL Search Path issue". Possible ways to get though are:
- Make sure "<Alias 2021.3 installation path>/bin" is first in PATH
This could be achieved by introducing a batch file / power shell script which changes the PATH environment variable accordingly, then starts your executable, and finally changes the PATH environment variable back its original value. (You might even want to consider to add a short cut to your desktop which calls that batch file. This is helpful in case users will call your program quite frequently.)
- Make sure your executable is started from "<Alias 2021.3 installation path>/bin"
This could be achieved by either introducing a batch file, or by adding a desktop short cut and adjusting the "Start in" location in the properties of that short cut
There might be more possible solutions. I guess the ones I have listed already meet your requirements.
Hth
Thomas
Thomas Rausch
Software Development Manager