DRo*_*kie 6 versioning delphi dll
我有一个使用DLL生成fastReports文件的应用程序.
当我需要更改报表数据结构时,我只更改此DLL并将其分发给APP的所有用户.如何在开始之前保证所有版本都有最新版本?
如何从DLL文件生成/提取此信息.
小智 12
此函数将fileversion作为字符串:
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;
Run Code Online (Sandbox Code Playgroud)
获取Dll版本:
function GetDllVersion: string; //Run in dll project
var
fn: string;
begin
fn := GetModuleName(HInstance);
Result := FileVersionGet(fn); // use Matthias's function
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4736 次 |
| 最近记录: |