Here is my custom page definition so far:
var
{ Backup Settings Page & Controls }
pageAutoBackup: TWizardPage;
btnSelectBackupFolder: TNewButton;
textBackupFolder: TNewEdit;
lblWhereToBackup: TLabel;
lblPromptMode: TLabel;
comboPromptMode: TNewComboBox;
lblReminder: TLabel;
radioBackupModeManual: TNewRadioButton;
radioBackupModeAuto: TNewRadioButton;
lblHowToBackup: TLabel;
radioBackupHowEssential: TNewRadioButton;
radioBackupHowComplete: TNewRadioButton;
radioBackupHowNone: TNewRadioButton;
lblWhatToBackup: TLabel;
panelWhatToPackup: TPanel;
panelHowToPackup: TPanel;
function pageAutoBackup_CreatePage(PreviousPageId: Integer): Integer;
begin
pageAutoBackup := CreateCustomPage(PreviousPageId, 'Automatic Backup', 'Configure automatic backup settings.');
{ panelWhatToPackup (TPanel) }
panelWhatToPackup := TPanel.Create(pageAutoBackup);
panelWhatToPackup.Caption := '';
panelWhatToPackup.BevelOuter := bvNone;
panelWhatToPackup.BevelInner := bvNone; { default }
panelWhatToPackup.BevelKind := bkNone;
panelWhatToPackup.Parent := pageAutoBackup.Surface;
panelWhatToPackup.Enabled := True;
panelWhatToPackup.Visible := True;
panelWhatToPackup.Left := ScaleX(0);
panelWhatToPackup.Top := ScaleY(0);
panelWhatToPackup.Width := pageAutoBackup.Surface.Width;
panelWhatToPackup.Height := ScaleY(90);
panelWhatToPackup.Anchors := [akLeft, akRight];
{ lblWhatToBackup (TLabel) }
lblWhatToBackup := TLabel.Create(pageAutoBackup);
lblWhatToBackup.Parent := panelWhatToPackup;
lblWhatToBackup.Enabled := True;
lblWhatToBackup.Visible := True;
lblWhatToBackup.Width := panelWhatToPackup.Width;
lblWhatToBackup.Font.Color := $000000;
lblWhatToBackup.Color := $F0F0F0;
lblWhatToBackup.Caption := 'What to backup:';
{ radioBackupHowNone (TNewRadioButton) }
radioBackupHowNone := TNewRadioButton.Create(pageAutoBackup);
radioBackupHowNone.Parent := panelWhatToPackup;
radioBackupHowNone.Enabled := True;
radioBackupHowNone.Visible := True;
radioBackupHowNone.Top := lblWhatToBackup.Top + lblWhatToBackup.Height + ScaleY(2);
radioBackupHowNone.Width := panelWhatToPackup.Width;
radioBackupHowNone.Checked := False;
radioBackupHowNone.Font.Color := $000000;
radioBackupHowNone.Color := $F0F0F0;
radioBackupHowNone.Caption := 'Don''t perform any backup when the program shuts down';
{ radioBackupHowComplete (TNewRadioButton) }
radioBackupHowComplete := TNewRadioButton.Create(pageAutoBackup);
radioBackupHowComplete.Parent := panelWhatToPackup;
radioBackupHowComplete.Enabled := True;
radioBackupHowComplete.Visible := True;
radioBackupHowComplete.Top := radioBackupHowNone.Top + radioBackupHowNone.Height + ScaleY(2);
radioBackupHowComplete.Width := panelWhatToPackup.Width;
radioBackupHowComplete.Checked := False;
radioBackupHowComplete.Font.Color := $000000;
radioBackupHowComplete.Color := $F0F0F0;
radioBackupHowComplete.Caption := 'Make a complete backup when the program shuts down';
{ radioBackupHowEssential (TNewRadioButton) }
radioBackupHowEssential := TNewRadioButton.Create(pageAutoBackup);
radioBackupHowEssential.Parent := panelWhatToPackup;
radioBackupHowEssential.Enabled := True;
radioBackupHowEssential.Visible := True;
radioBackupHowEssential.Top := radioBackupHowComplete.Top + radioBackupHowComplete.Height + ScaleY(2);
radioBackupHowEssential.Width := panelWhatToPackup.Width;
radioBackupHowEssential.Checked := False;
radioBackupHowEssential.Font.Color := $000000;
radioBackupHowEssential.Color := $F0F0F0;
radioBackupHowEssential.Caption := 'Only make an essential backup when the program shuts down';
{ panelHowToPackup (TPanel) }
panelHowToPackup := TPanel.Create(pageAutoBackup);
panelHowToPackup.Caption := '';
panelHowToPackup.BevelOuter := bvNone;
panelHowToPackup.BevelInner := bvNone; { default }
panelHowToPackup.BevelKind := bkNone;
panelHowToPackup.Parent := pageAutoBackup.Surface;
panelHowToPackup.Enabled := True;
panelHowToPackup.Visible := True;
panelHowToPackup.Top := panelWhatToPackup.Top + panelWhatToPackup.Height + ScaleY(2);
panelHowToPackup.Width := pageAutoBackup.Surface.Width;
panelHowToPackup.Height := ScaleY(100);
panelHowToPackup.Anchors := [akLeft, akRight];
{ lblHowToBackup (TLabel) }
lblHowToBackup := TLabel.Create(pageAutoBackup);
lblHowToBackup.Parent := panelHowToPackup;
lblHowToBackup.Enabled := True;
lblHowToBackup.Visible := True;
lblHowToBackup.Width := panelHowToPackup.Width;
lblHowToBackup.Font.Color := $000000;
lblHowToBackup.Color := $F0F0F0;
lblHowToBackup.Caption := 'How to backup:';
{ radioBackupModeAuto (TNewRadioButton) }
radioBackupModeAuto := TNewRadioButton.Create(pageAutoBackup);
radioBackupModeAuto.Parent := panelHowToPackup;
radioBackupModeAuto.Enabled := True;
radioBackupModeAuto.Visible := True;
radioBackupModeAuto.Left := ScaleX(0);
radioBackupModeAuto.Top := lblHowToBackup.Top + lblHowToBackup.Height + ScaleY(2);
radioBackupModeAuto.Width := panelHowToPackup.Width;
radioBackupModeAuto.Checked := False;
radioBackupModeAuto.Font.Color := $000000;
radioBackupModeAuto.Color := $F0F0F0;
radioBackupModeAuto.Caption := 'Perform automatically when the program is shut down';
{ radioBackupModeManual (TNewRadioButton) }
radioBackupModeManual := TNewRadioButton.Create(pageAutoBackup);
radioBackupModeManual.Parent := panelHowToPackup;
radioBackupModeManual.Enabled := True;
radioBackupModeManual.Visible := True;
radioBackupModeManual.Top := radioBackupModeAuto.Top + radioBackupModeAuto.Height + ScaleY(2);
radioBackupModeManual.Width := panelHowToPackup.Width;
radioBackupModeManual.Checked := False;
radioBackupModeManual.Font.Color := $000000;
radioBackupModeManual.Color := $F0F0F0;
radioBackupModeManual.Caption := 'Prompt the user when the program is shut down';
{ lblPromptMode (TLabel) }
lblPromptMode := TLabel.Create(pageAutoBackup);
lblPromptMode.Parent := panelHowToPackup;
lblPromptMode.Enabled := True;
lblPromptMode.Visible := True;
lblPromptMode.Top := radioBackupModeManual.Top + radioBackupModeManual.Height + ScaleY(2);
lblPromptMode.Width := panelHowToPackup.Width;
lblPromptMode.Font.Color := $000000;
lblPromptMode.Color := $F0F0F0;
lblPromptMode.Caption := 'Also prompt to backup at the following intervals while the application is running:';
{ comboPromptMode (TNewComboBox) }
comboPromptMode := TNewComboBox.Create(pageAutoBackup);
comboPromptMode.Parent := panelHowToPackup;
comboPromptMode.Style := csDropDownList;
comboPromptMode.Enabled := True;
comboPromptMode.Visible := True;
comboPromptMode.Top := lblPromptMode.Top + lblPromptMode.Height + ScaleY(2);
comboPromptMode.Width := panelHowToPackup.Width;
comboPromptMode.Font.Color := $000000;
comboPromptMode.ItemIndex := 0;
comboPromptMode.Color := $FFFFFF;
comboPromptMode.Items.Add('Never prompt to backup');
comboPromptMode.Items.Add('Prompt to backup everyday');
comboPromptMode.Items.Add('Prompt to backup once a week');
comboPromptMode.Items.Add('Prompt to backup once a month');
comboPromptMode.Anchors := [akLeft, akRight];
{ lblWhereToBackup (TLabel) }
lblWhereToBackup := TLabel.Create(pageAutoBackup);
lblWhereToBackup.Parent := pageAutoBackup.Surface;
lblWhereToBackup.Enabled := True;
lblWhereToBackup.Visible := True;
lblWhereToBackup.Top := panelHowToPackup.Top + panelHowToPackup.Height + ScaleY(2);
lblWhereToBackup.Width := panelHowToPackup.Width;
lblWhereToBackup.Font.Color := $000000;
lblWhereToBackup.Color := $F0F0F0;
lblWhereToBackup.Caption := 'Where to backup:';
lblWhereToBackup.Anchors := [akLeft, akRight, akBottom];
{ textBackupFolder (TNewEdit) }
textBackupFolder := TNewEdit.Create(pageAutoBackup);
textBackupFolder.Parent := pageAutoBackup.Surface;
textBackupFolder.Enabled := True;
textBackupFolder.Visible := True;
textBackupFolder.Top := lblWhereToBackup.Top + lblWhereToBackup.Height + ScaleY(2);
textBackupFolder.Width := ScaleX(335);
textBackupFolder.Font.Color := $000000;
textBackupFolder.Color := $F0F0F0;
textBackupFolder.Anchors := [akLeft, akRight, akBottom];
{ btnSelectBackupFolder (TNewButton) }
btnSelectBackupFolder := TNewButton.Create(pageAutoBackup);
btnSelectBackupFolder.Parent := pageAutoBackup.Surface;
btnSelectBackupFolder.Enabled := True;
btnSelectBackupFolder.Visible := True;
btnSelectBackupFolder.Left := ScaleX(340);
btnSelectBackupFolder.Top := textBackupFolder.Top;
btnSelectBackupFolder.Width := ScaleX(75);
btnSelectBackupFolder.Caption := 'Browse ...';
btnSelectBackupFolder.Anchors := [akRight, akBottom];
btnSelectBackupFolder.OnClick := #btnSelectBackupFolder_Click;
Result := pageAutoBackup.ID;
end;
This is what it looks like at smallest size possible:
Due to limited space I decided to remove one of the static labels as it was not really needed.
This is what it looks like when resized:
It is looking good. My queries relate to some specific sizes of controls:
I had to manually come up with figures for the heights of the TPanels or have I got that logic wrong? I now realise that the "Where to Backup" controls are just part of the second panel. Should I be added a third? I just didn't know how to work out the height needed for a panel to cover the controls on it.
You already correctly place the controls relatively to the previous controls.
So use the same logic to size the panels. Once you place the last control, query its position (bottom edge), add some margin, and use that for the panel height.
panelWhatToPackup.ClientHeight :=
radioBackupHowEssential.Top + radioBackupHowEssential.Height + ScaleY(8);
There's a caveat: Checkboxes and radio buttons created on run-time in Inno Setup do not scale automatically. You have to correct their height programmatically:
Scale radio button list with font size
Related
I'm trying to create something like this:
I want the check box to be hidden behind the lock image, and clicking on it will open a form requesting code entry, and if the code is correct the image will be removed and the check box will be available.
Here's what I tried:
[files]
Source: "Lock.bmp"; Flags: dontcopy
{...}
[code]
var
CustomFuncPage: TWizardPage;
CBAdvFunctions: TNewCheckBox;
Locked: TBitmapImage;
procedure OnClickLock(Sender: TObject);
var
PassForm: TSetupForm;
Edit: TNewEdit;
OKButton, CancelButton: TNewButton;
begin
PassForm := CreateCustomForm();
PassForm.ClientWidth := ScaleX(256);
PassForm.ClientHeight := ScaleY(128);
PassForm.Caption := 'Password required';
Edit := TNewEdit.Create(PassForm);
Edit.Top := ScaleY(10);
Edit.Left := ScaleX(10);
Edit.Width := PassForm.ClientWidth - ScaleX(20);
Edit.Height := ScaleY(23);
Edit.Anchors := [akLeft, akTop, akRight];
Edit.Parent := PassForm;
OKButton := TNewButton.Create(PassForm);
OKButton.Parent := PassForm;
OKButton.Caption := 'OK';
OKButton.Left := PassForm.ClientWidth - ScaleX(166);
OKButton.Top := PassForm.ClientHeight - ScaleY(33);
OKButton.Height := ScaleY(23);
OKButton.Anchors := [akRight, akBottom]
OKButton.ModalResult := mrOk;
OKButton.Default := True;
CancelButton := TNewButton.Create(PassForm);
CancelButton.Parent := PassForm;
CancelButton.Caption := 'Cancel';
CancelButton.Left := PassForm.ClientWidth - ScaleX(85);
CancelButton.Top := PassForm.ClientHeight - ScaleY(33);
CancelButton.Height := ScaleY(23);
CancelButton.Anchors := [akRight, akBottom]
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;
PassForm.ActiveControl := Edit;
if PassForm.ShowModal() = mrOk then
begin
if Edit.Text = '1234' then
begin
Locked.Free;
PassForm.Free;
end else
begin
MsgBox('Password incorrect', mbError, MB_OK);
PassForm.Free;
end;
end else
begin
PassForm.Free;
end;
end;
Procedure InitializeWizard;
begin
CustomFuncPage := CreateCustomPage(wpSelectProgramGroup, {...}, {...});
CBAdvFunctions := TNewCheckBox.Create(CustomFuncPage);
CBAdvFunctions.Parent := CustomFuncPage.Surface;
CBAdvFunctions.Top := 0;
CBAdvFunctions.Left := 0;
CBAdvFunctions.Caption := 'Advanced Functions'
CBAdvFunctions.Width := ScaleX(130);
CBAdvFunctions.Cursor := 1;
CBAdvFunctions.SendToBack;
ExtractTemporaryFile('Lock.bmp');
Locked := TBitmapImage.Create(CustomFuncPage);
Locked.Parent := CustomFuncPage.Surface;
Locked.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Lock.bmp'));
Locked.Bitmap.AlphaFormat := afPremultiplied;
Locked.SetBounds(0, 0, CBAdvFunctions.Width, CBAdvFunctions.Height);
Locked.Stretch := True;
Locked.BringToFront;
Locked.OnClick := #OnClickLock;
{...}
And this is the result:
This is the image I used:
I tried a few ways, but was unable to get the image to cover the checkbox.
Maybe someone has an idea?
By the way, maybe someone has an explanation for why the background of the image is not transparent?
As the question says i want to start typing from the center intead of starting from the left.
A short code value:
with WizardForm.UserInfoNameEdit do
begin
Left := ScaleX(104);
Top := ScaleY(182);
Width := ScaleX(233);
Height := ScaleY(31);
Font.Height := -19;
MaxLength := 30;
ParentFont := False;
end;
here some images:
According to your third picture you may use a custom form and position your controls in the center of your form.
function CreateMyCustomUserDialog(): Boolean;
var
Form: TSetupForm;
OKButton, CancelButton: TNewButton;
Label1: TLabel;
Edit1: TEdit;
begin
Form := CreateCustomForm();
try
Form.ClientWidth := ScaleX(256);
Form.ClientHeight := ScaleY(256);
Form.Caption := 'User Information';
Form.CenterInsideControl(WizardForm, true);
OKButton := TNewButton.Create(Form);
OKButton.Parent := Form;
OKButton.Width := ScaleX(75);
OKButton.Height := ScaleY(23);
OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 10);
OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);
OKButton.Caption := 'OK';
OKButton.ModalResult := mrOk;
Label1 := TLabel.Create(Form);
Label1.Parent := Form;
Label1.Alignment := taCenter;
Label1.Caption := 'Username:';
Label1.Width := Form.ClientWidth;
Label1.Height := ScaleY(23);
Label1.Top := 30;
Edit1 := TEdit.Create(Form);
Edit1.Parent := Form;
Edit1.Top := 50;
Edit1.Width := 100;
Edit1.Left := (Form.ClientWidth - Edit1.Width) / 2;
Edit1.Text := 'Admin';
CancelButton := TNewButton.Create(Form);
CancelButton.Parent := Form;
CancelButton.Width := ScaleX(75);
CancelButton.Height := ScaleY(23);
CancelButton.Left := Form.ClientWidth - ScaleX(75 + 10);
CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
CancelButton.Caption := 'Cancel';
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;
Form.ActiveControl := OKButton;
if Form.ShowModal() = mrOk then
MsgBox('You clicked OK.', mbInformation, MB_OK);
finally
Form.Free();
end;
end;
How do I WelcomeLabel on Inno Setup does not appear and leave only the text over the image.
This is that i want.
Something like this might do the trick. Since the welcome labels don't support transparency, you need to workaround this by creating your own with a different class (that has a transparency support), inherit the parent, font, text and size and hide the original ones. Here is the script how to do this:
[Code]
procedure InheritBoundsRect(ASource, ATarget: TControl);
begin
ATarget.Left := ASource.Left;
ATarget.Top := ASource.Top;
ATarget.Width := ASource.Width;
ATarget.Height := ASource.Height;
end;
procedure InitializeWizard;
var
TopWelcomeLabel: TLabel;
BottomWelcomeLabel: TLabel;
begin
WizardForm.WizardBitmapImage.Align := alClient;
WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('D:\Image.bmp');
TopWelcomeLabel := TLabel.Create(WizardForm);
TopWelcomeLabel.Parent := WizardForm.WelcomeLabel1.Parent;
TopWelcomeLabel.Font := WizardForm.WelcomeLabel1.Font;
TopWelcomeLabel.Caption := WizardForm.WelcomeLabel1.Caption;
TopWelcomeLabel.WordWrap := WizardForm.WelcomeLabel1.WordWrap;
InheritBoundsRect(WizardForm.WelcomeLabel1, TopWelcomeLabel);
WizardForm.WelcomeLabel1.Visible := False;
BottomWelcomeLabel := TLabel.Create(WizardForm);
BottomWelcomeLabel.Parent := WizardForm.WelcomeLabel2.Parent;
BottomWelcomeLabel.Font := WizardForm.WelcomeLabel2.Font;
BottomWelcomeLabel.Caption := WizardForm.WelcomeLabel2.Caption;
BottomWelcomeLabel.WordWrap := WizardForm.WelcomeLabel2.WordWrap;
InheritBoundsRect(WizardForm.WelcomeLabel2, BottomWelcomeLabel);
WizardForm.WelcomeLabel2.Visible := False;
end;
And the result:
I'm afraid what you want may not be possible or rather difficult, even if creating a custom page. Have a look at the CreateCustomPage() function and the example scripts included with your Inno Setup installation.
This code can help you. Just change the Welcome page, but you can try with other pages of the installer.
[code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
end;
function GetCustomSetupExitCode(): Integer;
begin
Result := 1;
end;
procedure InitializeWizard();
var
WLabel1, WLabel2,
FLabel1, FLabel2: TLabel;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := 500;
WizardForm.WizardBitmapImage.Height := 315;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Name := 'verdana';
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clBlack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Name := 'tahoma';
WLabel2.Font.Color:= clBlack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := 500;
WizardForm.WizardBitmapImage2.Height := 315;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Name := 'verdana';
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clBlack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Name := 'tahoma';
FLabel2.Font.Color:= clBlack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := WizardForm.FinishedLabel.Caption;
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
end;
How do I WelcomeLabel on Inno Setup does not appear and leave only the text over the image.
This is that i want.
Something like this might do the trick. Since the welcome labels don't support transparency, you need to workaround this by creating your own with a different class (that has a transparency support), inherit the parent, font, text and size and hide the original ones. Here is the script how to do this:
[Code]
procedure InheritBoundsRect(ASource, ATarget: TControl);
begin
ATarget.Left := ASource.Left;
ATarget.Top := ASource.Top;
ATarget.Width := ASource.Width;
ATarget.Height := ASource.Height;
end;
procedure InitializeWizard;
var
TopWelcomeLabel: TLabel;
BottomWelcomeLabel: TLabel;
begin
WizardForm.WizardBitmapImage.Align := alClient;
WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('D:\Image.bmp');
TopWelcomeLabel := TLabel.Create(WizardForm);
TopWelcomeLabel.Parent := WizardForm.WelcomeLabel1.Parent;
TopWelcomeLabel.Font := WizardForm.WelcomeLabel1.Font;
TopWelcomeLabel.Caption := WizardForm.WelcomeLabel1.Caption;
TopWelcomeLabel.WordWrap := WizardForm.WelcomeLabel1.WordWrap;
InheritBoundsRect(WizardForm.WelcomeLabel1, TopWelcomeLabel);
WizardForm.WelcomeLabel1.Visible := False;
BottomWelcomeLabel := TLabel.Create(WizardForm);
BottomWelcomeLabel.Parent := WizardForm.WelcomeLabel2.Parent;
BottomWelcomeLabel.Font := WizardForm.WelcomeLabel2.Font;
BottomWelcomeLabel.Caption := WizardForm.WelcomeLabel2.Caption;
BottomWelcomeLabel.WordWrap := WizardForm.WelcomeLabel2.WordWrap;
InheritBoundsRect(WizardForm.WelcomeLabel2, BottomWelcomeLabel);
WizardForm.WelcomeLabel2.Visible := False;
end;
And the result:
I'm afraid what you want may not be possible or rather difficult, even if creating a custom page. Have a look at the CreateCustomPage() function and the example scripts included with your Inno Setup installation.
This code can help you. Just change the Welcome page, but you can try with other pages of the installer.
[code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
end;
function GetCustomSetupExitCode(): Integer;
begin
Result := 1;
end;
procedure InitializeWizard();
var
WLabel1, WLabel2,
FLabel1, FLabel2: TLabel;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := 500;
WizardForm.WizardBitmapImage.Height := 315;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Name := 'verdana';
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clBlack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Name := 'tahoma';
WLabel2.Font.Color:= clBlack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := 500;
WizardForm.WizardBitmapImage2.Height := 315;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Name := 'verdana';
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clBlack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Name := 'tahoma';
FLabel2.Font.Color:= clBlack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := WizardForm.FinishedLabel.Caption;
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
end;
How do I WelcomeLabel on Inno Setup does not appear and leave only the text over the image.
This is that i want.
Something like this might do the trick. Since the welcome labels don't support transparency, you need to workaround this by creating your own with a different class (that has a transparency support), inherit the parent, font, text and size and hide the original ones. Here is the script how to do this:
[Code]
procedure InheritBoundsRect(ASource, ATarget: TControl);
begin
ATarget.Left := ASource.Left;
ATarget.Top := ASource.Top;
ATarget.Width := ASource.Width;
ATarget.Height := ASource.Height;
end;
procedure InitializeWizard;
var
TopWelcomeLabel: TLabel;
BottomWelcomeLabel: TLabel;
begin
WizardForm.WizardBitmapImage.Align := alClient;
WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('D:\Image.bmp');
TopWelcomeLabel := TLabel.Create(WizardForm);
TopWelcomeLabel.Parent := WizardForm.WelcomeLabel1.Parent;
TopWelcomeLabel.Font := WizardForm.WelcomeLabel1.Font;
TopWelcomeLabel.Caption := WizardForm.WelcomeLabel1.Caption;
TopWelcomeLabel.WordWrap := WizardForm.WelcomeLabel1.WordWrap;
InheritBoundsRect(WizardForm.WelcomeLabel1, TopWelcomeLabel);
WizardForm.WelcomeLabel1.Visible := False;
BottomWelcomeLabel := TLabel.Create(WizardForm);
BottomWelcomeLabel.Parent := WizardForm.WelcomeLabel2.Parent;
BottomWelcomeLabel.Font := WizardForm.WelcomeLabel2.Font;
BottomWelcomeLabel.Caption := WizardForm.WelcomeLabel2.Caption;
BottomWelcomeLabel.WordWrap := WizardForm.WelcomeLabel2.WordWrap;
InheritBoundsRect(WizardForm.WelcomeLabel2, BottomWelcomeLabel);
WizardForm.WelcomeLabel2.Visible := False;
end;
And the result:
I'm afraid what you want may not be possible or rather difficult, even if creating a custom page. Have a look at the CreateCustomPage() function and the example scripts included with your Inno Setup installation.
This code can help you. Just change the Welcome page, but you can try with other pages of the installer.
[code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
end;
function GetCustomSetupExitCode(): Integer;
begin
Result := 1;
end;
procedure InitializeWizard();
var
WLabel1, WLabel2,
FLabel1, FLabel2: TLabel;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := 500;
WizardForm.WizardBitmapImage.Height := 315;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Name := 'verdana';
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clBlack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Name := 'tahoma';
WLabel2.Font.Color:= clBlack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := 500;
WizardForm.WizardBitmapImage2.Height := 315;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Name := 'verdana';
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clBlack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Name := 'tahoma';
FLabel2.Font.Color:= clBlack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := WizardForm.FinishedLabel.Caption;
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
end;