Subversion Repositories ExamClock

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 ron.wellst 1
unit Unit1;
2
 
3
{$mode objfpc}{$H+}
4
 
5
interface
6
 
7
uses
8
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
9
  Buttons, StdCtrls, fileinfo;
10
 
11
type
12
 
13
  { TForm1 }
14
 
15
  TForm1 = class(TForm)
16
    CompanyLabel: TLabel;
17
    CopyrightLabel: TLabel;
18
    VersionLabel: TLabel;
19
    NameLabel: TLabel;
20
    OkButton: TBitBtn;
21
    Image1: TImage;
22
    procedure FormShow(Sender: TObject);
23
  private
24
    { private declarations }
25
  public
26
    { public declarations }
27
  end;
28
 
29
var
30
  Form1: TForm1;
31
 
32
implementation
33
 
34
{$R *.lfm}
35
 
36
{ TForm1 }
37
 
38
procedure TForm1.FormShow(Sender: TObject);
39
var
40
  FileVerInfo: TFileVersionInfo;
41
begin
42
  FileVerInfo := TFileVersionInfo.Create(nil);
43
  try
44
    FileVerInfo.FileName := paramstr(0);
45
    FileVerInfo.ReadFileInfo;
46
    NameLabel.Caption := FileVerInfo.VersionStrings.Values['ProductName'];
47
    CompanyLabel.Caption := FileVerInfo.VersionStrings.Values['CompanyName'];
48
    CopyrightLabel.Caption := FileVerInfo.VersionStrings.Values['LegalCopyright'];
49
    VersionLabel.Caption := 'Version: ' +
50
                         FileVerInfo.VersionStrings.Values['FileVersion'];
51
  finally
52
    FileVerInfo.Free;
53
  end;
54
 
55
end;
56
 
57
end.
58