I'm afraid that in order to achieve what you want, when your application is developed it should be configured to search the related dll relative to EXE. You can take a look on "Dynamic-Link Library Search Order (Windows)" article which may be useful for you.1) Force and update for each dll. For example, the first offending dll is ws2_32.dll found in \Windows\System32. The target machine's is out of date. I could copy the new on in on top of that one.
Problems: this assumes the new dll is always backwards compatible. I don't know if that is the case. Also, the target user may reinstall, say, and older SDK that re-establishes the older dll and my new .exe won't run anymore.
In order to achieve this you can add, for an environment variable, a prepend operation when existing on our "Environment Variables" page. Also, please keep in mind that the environment variables list will be updated only after the installation process is finished. So, if your application will be launched on ExitDialog, then in that moment the environment variable is not up to date.2) prepend a new APPDIR environment variable.
This would presumably let my .exe pick up the dependent dlls which I have installed in the same dir.
Problem: how to prepend into existing target env var chain.
Could you explain this a little more? What is the result of "searching the related dll"? Time and date? Functions it contains? For example, on the particular target machine I installed my .exe on, the old WS2_32.dll the function GetHostNameW was not found in the 11/20/2010 WS2_32.dll. I think either I replace the entire dll if the dates differ or not. But that leads to the problem, as I have already stated, that if the target machine user reinstalls the old version, then my .exe will not run. Maybe this is not a valid concern. The other objection I had was that this approach assumes the installed dll is backwards compatible. Is this a reasonably safe assumption? Is 7/20/2012 WS2_32.dll backwards compatible with WS2_32.dll 11/20/2010? I would assume so. Does anyone know whether this is a consistent policy or not?when your application is developed it should be configured to search the related dll relative to EXE
Unfortunately, this problem is caused by your application design. You should search an answer for this issue on development forums (e.g. http://stackoverflow.com). Also, you can take a look on "How can I tell the exe to use the local DLL instead of the registered one?" article.So altering the environment variables won't work. Then let's concentrate on running the .exe with the appropriate dependent .dlls. The installer copies all the dependent .dlls into APPDIR where the .exe is installed, but they are not being used. Why is this?
No, I'm afraid this is not related to the MSI installation.Is it because the .msi is copied into a temporary folder somewhere and being run from there?
FOLLOW US
Get the latest news in Application Packaging