Subversion Repositories ExamClock

Rev

Blame | Last modification | View Log | RSS feed

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  Buttons, StdCtrls, fileinfo;

type

  { TForm1 }

  TForm1 = class(TForm)
    CompanyLabel: TLabel;
    CopyrightLabel: TLabel;
    VersionLabel: TLabel;
    NameLabel: TLabel;
    OkButton: TBitBtn;
    Image1: TImage;
    procedure FormShow(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormShow(Sender: TObject);
var
  FileVerInfo: TFileVersionInfo;
begin
  FileVerInfo := TFileVersionInfo.Create(nil);
  try
    FileVerInfo.FileName := paramstr(0);
    FileVerInfo.ReadFileInfo;
    NameLabel.Caption := FileVerInfo.VersionStrings.Values['ProductName'];
    CompanyLabel.Caption := FileVerInfo.VersionStrings.Values['CompanyName'];
    CopyrightLabel.Caption := FileVerInfo.VersionStrings.Values['LegalCopyright'];
    VersionLabel.Caption := 'Version: ' +
                         FileVerInfo.VersionStrings.Values['FileVersion'];
  finally
    FileVerInfo.Free;
  end;

end;

end.