uses
SysUtils, ImageHlp;
function GetAppVersionStr: string;
function TformSpalsh.GetAppVersionStr: string;
var
Exe: string;
Size, Handle: DWORD;
Buffer: TBytes;
FixedPtr: PVSFixedFileInfo;
begin
Exe := ParamStr(0);
Size := GetFileVersionInfoSize(PChar(Exe), Handle);
if Size = 0 then
RaiseLastOSError;
SetLength(Buffer, Size);
if not GetFileVersionInfo(PChar(Exe), Handle, Size, Buffer) then
RaiseLastOSError;
if not VerQueryValue(Buffer, '\', Pointer(FixedPtr), Size) then
RaiseLastOSError;
Result := Format('%d.%d.%d.%d',
[LongRec(FixedPtr.dwFileVersionMS).Hi, //major
LongRec(FixedPtr.dwFileVersionMS).Lo, //minor
LongRec(FixedPtr.dwFileVersionLS).Hi, //release
LongRec(FixedPtr.dwFileVersionLS).Lo]) //build
end;
procedure TformSpalsh.FormCreate(Sender: TObject);
var
Rec: LongRec;
fileDate : Integer;
begin
fileDate := FileAge('E_MultiDrugs.exe');
Label1.Caption := DateToStr(FileDateToDateTime(fileDate));
Label2.Caption := GetAppVersionStr();
end;
Subscribe to:
Post Comments (Atom)
Postgress - Read a XML file from a postgress table XML column
SELECT xmltable.* FROM xmldata, XMLTABLE('//ROWS/ROW' PASSING data COLUMNS id int PATH ...
-
if more than 65535 files in your temp folder, this error can occurs, To resolve this, remove all temporary files in C:/Windows/Temp ....
-
select upper(substr(CTY_CITY,1,1))|| substr(CTY_CITY,2,length(CTY_CITY)-1) as Ax from AGM_M_COUNTRY_CITY; update AGM_M_COUNTRY_CITY set ...
-
Common text box validation function for all the text boxes within the same form. Using Sender parameter to handle. private void tex...
No comments:
Post a Comment