This repository has been archived by the owner on Mar 22, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
isdonateandmail.iss
68 lines (60 loc) · 2.29 KB
/
isdonateandmail.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// -- IsDonateAndMail.iss --
// Include file which adds donate and subscribe buttons to Setup
//
[Files]
Source: "isdonate.bmp"; Flags: dontcopy
Source: "ismail.bmp"; Flags: dontcopy
[CustomMessages]
; No need to localize: The IS website is in English only
IsDonateAndMailDonateHint=Support Inno Setup - Thank you!
IsDonateAndMailMailHint=Be notified by e-mail of new Inno Setup releases
[Code]
procedure DonateImageOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExecAsOriginalUser('open', 'https://jrsoftware.org/isdonate.php', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure MailImageOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExecAsOriginalUser('open', 'https://jrsoftware.org/ismail.php', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
<event('InitializeWizard')>
procedure IsDonateAndMailInitializeWizard;
var
ImageFileName: String;
DonateImage, MailImage: TBitmapImage;
BevelTop: Integer;
begin
if WizardSilent then
Exit;
ImageFileName := ExpandConstant('{tmp}\isdonate.bmp');
ExtractTemporaryFile(ExtractFileName(ImageFileName));
DonateImage := TBitmapImage.Create(WizardForm);
DonateImage.AutoSize := True;
DonateImage.Bitmap.LoadFromFile(ImageFileName);
DonateImage.Hint := CustomMessage('IsDonateAndMailDonateHint');
DonateImage.ShowHint := True;
DonateImage.Anchors := [akLeft, akBottom];
BevelTop := WizardForm.Bevel.Top;
DonateImage.Top := BevelTop + (WizardForm.ClientHeight - BevelTop - DonateImage.Bitmap.Height) div 2;
DonateImage.Left := DonateImage.Top - BevelTop;
DonateImage.Cursor := crHand;
DonateImage.OnClick := @DonateImageOnClick;
DonateImage.Parent := WizardForm;
ImageFileName := ExpandConstant('{tmp}\ismail.bmp');
ExtractTemporaryFile(ExtractFileName(ImageFileName));
MailImage := TBitmapImage.Create(WizardForm);
MailImage.AutoSize := True;
MailImage.Bitmap.LoadFromFile(ImageFileName);
MailImage.Hint := CustomMessage('IsDonateAndMailMailHint');
MailImage.ShowHint := True;
MailImage.Anchors := [akLeft, akBottom];
MailImage.Top := DonateImage.Top
MailImage.Left := DonateImage.Left + DonateImage.Width + ScaleX(8);
MailImage.Cursor := crHand;
MailImage.OnClick := @MailImageOnClick;
MailImage.Parent := WizardForm;
end;