I have an application that uses a DLL to generate fastReports files.
When I need to make changes to the reports data structure I only change this DLL and distribute it to all user of the APP. How can I guarantee that all have the last version before they start?
How can I generate/Extract this information from the DLL file.
If you reference the dll in Visual Studio right click it (in ProjectName/References folder) and select "Properties" you have "Version" and "Runtime Version" there. In File Explorer when you right click the dll file and select properties there is a "File Version" and "Product Version" there.
dll (Version Checking and File Installation) – Details. The file version. dll contains program code used by windows to perform version checking on other libraries and other supporting files.
You can use the FileVersionInfo. FileVersion property with the Get-Command to get the file version in PowerShell. The following command gets the file version number of a file C:\Windows\System32\ActionCenter. dll .
This function will get the fileversion as 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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With