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 | |
---|
1 | unit UFormMain;
|
---|
2 |
|
---|
3 | {$mode objfpc}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
---|
9 | EditBtn, UUpdateChecker, DateUtils;
|
---|
10 |
|
---|
11 | type
|
---|
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 |
|
---|
34 | var
|
---|
35 | Form1: TForm1;
|
---|
36 |
|
---|
37 | implementation
|
---|
38 |
|
---|
39 | {$R *.lfm}
|
---|
40 |
|
---|
41 | { TForm1 }
|
---|
42 |
|
---|
43 | procedure TForm1.Button1Click(Sender: TObject);
|
---|
44 | begin
|
---|
45 |
|
---|
46 | end;
|
---|
47 |
|
---|
48 | procedure TForm1.ButtonCheckClick(Sender: TObject);
|
---|
49 | begin
|
---|
50 | Memo1.Lines.SaveToFile(UpdateChecker1.VersionInfoURL);
|
---|
51 | UpdateChecker1.Check(DateEdit1.Date);
|
---|
52 | end;
|
---|
53 |
|
---|
54 | procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
55 | begin
|
---|
56 | Memo1.Lines.SaveToFile(UpdateChecker1.VersionInfoURL);
|
---|
57 | end;
|
---|
58 |
|
---|
59 | procedure TForm1.FormShow(Sender: TObject);
|
---|
60 | begin
|
---|
61 | DateEdit1.Date := EncodeDate(2012, 11, 1);
|
---|
62 | Memo1.Lines.LoadFromFile(UpdateChecker1.VersionInfoURL);
|
---|
63 | end;
|
---|
64 |
|
---|
65 | procedure TForm1.UpdateChecker1Terminate(Sender: TObject);
|
---|
66 | begin
|
---|
67 | Application.Terminate;
|
---|
68 | end;
|
---|
69 |
|
---|
70 | end.
|
---|
71 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.