Add ismail button to Setup.

This commit is contained in:
Martijn Laan 2020-06-27 22:27:31 +02:00
parent 7c7b76a7c5
commit dc538b82a4
5 changed files with 55 additions and 33 deletions

View File

@ -1,32 +0,0 @@
[Files]
Source: "donate.bmp"; Flags: dontcopy
[Code]
procedure DonateImageOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExecAsOriginalUser('open', 'https://jrsoftware.org/isdonate.php', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
<event('InitializeWizard')>
procedure DonateImageInitializeWizard;
var
DonateImageFileName: String;
DonateImage: TBitmapImage;
BevelTop: Integer;
begin
DonateImageFileName := ExpandConstant('{tmp}\donate.bmp');
ExtractTemporaryFile(ExtractFileName(DonateImageFileName));
DonateImage := TBitmapImage.Create(WizardForm);
DonateImage.AutoSize := True;
DonateImage.Bitmap.LoadFromFile(DonateImageFileName);
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;
end;

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

54
isdonateandmail.iss Normal file
View File

@ -0,0 +1,54 @@
[Files]
Source: "isdonate.bmp"; Flags: dontcopy
Source: "ismail.bmp"; Flags: dontcopy
[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 DonateAndMailImagesInitializeWizard;
var
ImageFileName: String;
DonateImage, MailImage: TBitmapImage;
BevelTop: Integer;
begin
ImageFileName := ExpandConstant('{tmp}\isdonate.bmp');
ExtractTemporaryFile(ExtractFileName(ImageFileName));
DonateImage := TBitmapImage.Create(WizardForm);
DonateImage.AutoSize := True;
DonateImage.Bitmap.LoadFromFile(ImageFileName);
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.Anchors := [akLeft, akBottom];
BevelTop := WizardForm.Bevel.Top;
MailImage.Top := DonateImage.Top
MailImage.Left := DonateImage.Left + DonateImage.Width + ScaleX(8);
MailImage.Cursor := crHand;
MailImage.OnClick := @MailImageOnClick;
MailImage.Parent := WizardForm;
end;

BIN
ismail.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -5,7 +5,7 @@
;
; Setup script
#include "donate.iss"
#include "isdonateandmail.iss"
[Setup]
AppName=Inno Setup