Dll file version

I have an application that uses a DLL to generate fastReports files.

When I need to make changes to the report data structure, I only change this DLL and distribute it to all APP users. How can I guarantee that they all have the latest version before they are launched?

How can I generate / extract this information from a dll file.

+6
source share
4 answers

This function will receive fileversion as a string:

function FileVersionGet( const sgFileName : string ) : string; var infoSize: DWORD; var verBuf: pointer; var verSize: UINT; var wnd: UINT; var FixedFileInfo : PVSFixedFileInfo; begin infoSize := GetFileVersioninfoSize(PChar(sgFileName), wnd); result := ''; if infoSize <> 0 then begin GetMem(verBuf, infoSize); try if GetFileVersionInfo(PChar(sgFileName), wnd, infoSize, verBuf) then begin VerQueryValue(verBuf, '\', Pointer(FixedFileInfo), verSize); result := IntToStr(FixedFileInfo.dwFileVersionMS div $10000) + '.' + IntToStr(FixedFileInfo.dwFileVersionMS and $0FFFF) + '.' + IntToStr(FixedFileInfo.dwFileVersionLS div $10000) + '.' + IntToStr(FixedFileInfo.dwFileVersionLS and $0FFFF); end; finally FreeMem(verBuf); end; end; end; 
+12
source

Get Dll Version:

 function GetDllVersion: string; //Run in dll project var fn: string; begin fn := GetModuleName(HInstance); Result := FileVersionGet(fn); // use Matthias function end; 
+4
source

Use SysUtils.GetFileVersion()

Getting the file version requires first installing the file version.

+3
source

JCL has JclFileVersion. Two or three lines, and you're done.

0
source

Source: https://habr.com/ru/post/886267/


All Articles