Archive: VXD and GetDLLVersionLocal


VXD and GetDLLVersionLocal
Hi.

There is a problem in NSIS when you need to install VXD driver with version control. Altough GetDLLVersion works fine with VXD under Win9x systems (it doesn't work under NT systems, but it usually isn't required), but GetDLLVersionLocal fails when you're trying to build installation under NT system (which is usually the case).

The problem is that Win32 API functions GetFileVerisonInfoSize and GetFileVersionInfo do not work with LE format under NT system. So, I took the liberty of fixing that problem.

There is a topic in MSDN, named "HOWTO: Programmatically Retrieve a VxD's Version Information", it contains sample code which provides two functions - GetVxdVersionInfoSize and GetVxdVersionInfo, they are analogous to the GetFileVersionInfoSize and GetFileVersionInfo. I've put them into util.cpp/util.h (slightly rewritten). Then I've changed the logic of retrieving version info during GetDLLVersionLocal compiling (in script.cpp). First, the version info is retrieved the usual way, and if it fails, it is retrieved via new function pair. Now it works both on Win9x and NT systems. The attached file contains fixed source files. Of course, all the code is Win32-specific, so
required #ifdefs are in place.

Hope, you'll put this fix in the future updates of this great installer :)


Any chance you can convert it to using standard library functions so it'll work on *nix too?


I can try, but it'll do not much good, actually, because they're just retrieving version info data block from a file, and then this block is being parsed by Win32 function VerQueryValue.

For *nix support I suppose CResourceEditor should be somehow changed.


The code to extract VS_FIXEDFILEINFO from the resource is already written. The only problem is getting the resource from the LE.


Created patch tracker item and applied. Thanks.