source: UpdateChecker/Demo/UFormMain.pas

Last change on this file was 433, checked in by chronos, 12 years ago
  • Added: Custom new version info form with option to show release notes.
  • Fixed: Run setup with elevated privileges.
  • Added: Can read version info file from local filesystem.
  • Added: Demo application.
File size: 1.5 KB
Line 
1unit UFormMain;
2
3{$mode objfpc}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
9 EditBtn, UUpdateChecker, DateUtils;
10
11type
12
13 { TForm1 }
14
15 TForm1 = class(TForm)
16 ButtonCheck: TButton;
17 DateEdit1: TDateEdit;
18 Edit1: TEdit;
19 Label1: TLabel;
20 Label2: TLabel;
21 Memo1: TMemo;
22 UpdateChecker1: TUpdateChecker;
23 procedure Button1Click(Sender: TObject);
24 procedure ButtonCheckClick(Sender: TObject);
25 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
26 procedure FormShow(Sender: TObject);
27 procedure UpdateChecker1Terminate(Sender: TObject);
28 private
29 { private declarations }
30 public
31 { public declarations }
32 end;
33
34var
35 Form1: TForm1;
36
37implementation
38
39{$R *.lfm}
40
41{ TForm1 }
42
43procedure TForm1.Button1Click(Sender: TObject);
44begin
45
46end;
47
48procedure TForm1.ButtonCheckClick(Sender: TObject);
49begin
50 Memo1.Lines.SaveToFile(UpdateChecker1.VersionInfoURL);
51 UpdateChecker1.Check(DateEdit1.Date);
52end;
53
54procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
55begin
56 Memo1.Lines.SaveToFile(UpdateChecker1.VersionInfoURL);
57end;
58
59procedure TForm1.FormShow(Sender: TObject);
60begin
61 DateEdit1.Date := EncodeDate(2012, 11, 1);
62 Memo1.Lines.LoadFromFile(UpdateChecker1.VersionInfoURL);
63end;
64
65procedure TForm1.UpdateChecker1Terminate(Sender: TObject);
66begin
67 Application.Terminate;
68end;
69
70end.
71
Note: See TracBrowser for help on using the repository browser.