0

LMD components (LMD Innovative) has LMDVersionInfo component through which you can get all relevant data about your application (version info, build number,copyright...).

Does JVCL (JEDI Visual Component Library) have something similar ?

Arioch 'The
  • 15,799
  • 35
  • 62
user3351050
  • 368
  • 3
  • 14
  • The JVCL is primarily visual components (thus the *Visual Component Library* in the name). Have you looked at the JCL (JEDI Code Library) instead, specifically JclPEImage.GetVersionInfo? – Ken White Dec 31 '16 at 01:57
  • No,I never used this components before. – user3351050 Dec 31 '16 at 02:14
  • The JCL (which is not components, but code, thus the *Code Library) in the name) is required by JVCL, so you have it installed. I've suggested where you should look in that code library; you'll find it in the JCL\Windows\JclPEImage.pas file. – Ken White Dec 31 '16 at 02:16
  • Found the functions. So, nothing visual to use then ? – user3351050 Dec 31 '16 at 02:26
  • 1
    What would you expect to be *visual*? You read the information and put it into labels. At some point you have to learn that not every single thing you do is *drag and drop something on a form*; some things require you to write a line or two of code. – Ken White Dec 31 '16 at 02:28
  • Yes,you are right...Thank you. – user3351050 Dec 31 '16 at 02:30
  • You also can do this without Jedi. See this : http://stackoverflow.com/questions/6557778/get-fileversion-with-build/6558031#6558031 – Val Marinov Dec 31 '16 at 06:10
  • @user3351050 frankly, for this specific task using non-visual functions is much more concise and easy than using relatively heavyweight pseudo-visual wrapper. In the end you anyway go down to the sources and write Pascal code to toss values between properties and variables. KISS principle applies here. Version Info component is not User Interface. Also there is (next to) nothing to be adjusted there. Putting it as pseudo-visual thumb onto the form just bogs your down and ties your hands. It will come with more experience, when you would feel that dependencies are stealing your freedom – Arioch 'The Jan 08 '17 at 19:06

2 Answers2

1

LMD .... has LMDVersionInfo component

Yes, JediVCL has a similar thing too.

And the name is - would you ever manage to guess it? - Jv-Version-Info.

https://github.com/project-jedi/jvcl/blob/master/jvcl/run/JvVersionInfo.pas

Arioch 'The
  • 15,799
  • 35
  • 62
  • You have to add the *.pas file to use it. LMD you just call the component. – user3351050 Jan 04 '17 at 03:53
  • @user3351050 there is not difference between JVCL or LMD or even stock VCL, it is core of Delphi/Pascal language. When you use component (or any other entity) from another unit, you HAVE to import that unit via USES section. Another thing it that when you pick the component from the Pallette and drop it onto your Form then the IDE makes this check for you and if needed it silently adds that unit into USES section (but it does not remove that unit if you removed the component later). That is what most probably happened - you dropped the LMD component onto form visually and got USES auto-added – Arioch 'The Jan 08 '17 at 19:01
0

or just use :

procedure GetBuildInfo(var V1, V2, V3, V4: Word);
var
   VerInfoSize, VerValueSize, Dummy : DWORD;
   VerInfo : Pointer;
   VerValue : PVSFixedFileInfo;
begin
VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy);
GetMem(VerInfo, VerInfoSize);
GetFileVersionInfo(PChar(ParamStr(0)), 0, VerInfoSize, VerInfo);
VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
With VerValue^ do
begin
  V1 := dwFileVersionMS shr 16;
  V2 := dwFileVersionMS and $FFFF;
  V3 := dwFileVersionLS shr 16;
  V4 := dwFileVersionLS and $FFFF;
end;
FreeMem(VerInfo, VerInfoSize);
end;


function kfVersionInfo: String;
var
  V1,       // Major Version
  V2,       // Minor Version
  V3,       // Release
  V4: Word; // Build Number
begin
  GetBuildInfo(V1, V2, V3, V4);
  Result := IntToStr(V1) + '.'
            + IntToStr(V2) + '.'
            + IntToStr(V3) + '.'
            + IntToStr(V4);
end;
user763539
  • 3,509
  • 6
  • 44
  • 103