Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TVersion = record
- case Integer of
- 0: (Minor, Major, Build, Release: Word);
- 1: (All: array[1..4] of Word);
- 2: (MS, LS: LongInt);
- 3: (Vr : Int64);
- end;
- function TVersionInfo.GetFileVersion: TVersion;
- begin
- Result.Vr := 0;
- // FixedFileInfo: PVSFixedFileInfo;
- // https://docs.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo
- if Assigned(FixedFileInfo) then
- begin
- Result.MS := FixedFileInfo^.dwFileVersionMS;
- Result.LS := FixedFileInfo^.dwFileVersionLS;
- end;
- end;
- function CompareVersions(pVersion1, pVersion2: TVersion): Integer;
- begin
- Result := CompareValue(pVersion1.Vr, pVersion2.Vr);
- end;
- function LongVersionToString(const Version: TVersion): string;
- begin
- Result:='';
- with Version do
- Result := Format('%d.%d.%d.%d', [Major, Minor, Release, Build]);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement