Archive: GetDLLVersionLocal and PATH


GetDLLVersionLocal and PATH
Would it be possible to modify the GetDLLVersionLocal to use the PATH environment variable if the DLL can't be found directly, just like the OS does?

The reason I'm asking is that I don't want to hard-code paths in my NSIS scripts and I want those scripts to work on all systems without modifications.

I don't want to copy the DLL to the current directory either and I think lots of users that include DLLs would love this feature.


You'll have to execute and external application that writes a header file with the location.


GetDLLVersionLocal is usually used in conjunction with File. Both don't look in the PATH so you won't include wrong files by mistake.

If you want your script to work on all systems, you can read environment variables such as WINDIR using $%WINDIR%. For example:

GetDLLVersionLocal "$%WINDIR%\explorer.exe" $0 $1


The DLL I'd like to include is inside system32 and there's no env var that contains that path.

What is the chance the wrong DLL is being included, especially considering the OS would then probably load the wrong DLL too?