This is the code to fill the background of the Inno Setup with an image, and hide the inner and outer panels:
procedure InitializeWizard();
var
BackImage: TBitmapImage;
begin
{ Hide top panel }
WizardForm.MainPanel.Visible := False;
{ Adjust "select dir" page controls for a stretched inner page size }
WizardForm.DirEdit.Left := WizardForm.DirEdit.Left WizardForm.InnerNotebook.Left;
WizardForm.DirEdit.Top := WizardForm.DirEdit.Top WizardForm.InnerNotebook.Top;
WizardForm.DirBrowseButton.Left :=
WizardForm.DirBrowseButton.Left WizardForm.InnerNotebook.Left;
WizardForm.DirBrowseButton.Top :=
WizardForm.DirBrowseButton.Top WizardForm.InnerNotebook.Top;
{ Hide non-transparent labels }
WizardForm.DiskSpaceLabel.Visible := False;
WizardForm.SelectDirBrowseLabel.Visible := False;
WizardForm.SelectDirLabel.Visible := False;
{ Stretch the outer page across whole form }
WizardForm.OuterNotebook.Width := WizardForm.ClientWidth;
WizardForm.OuterNotebook.Height := WizardForm.ClientHeight;
{ Stretch the inner page across whole outer page }
WizardForm.InnerNotebook.Left := 0;
WizardForm.InnerNotebook.Top := 0;
WizardForm.InnerNotebook.Width := WizardForm.OuterNotebook.ClientWidth;
WizardForm.InnerNotebook.Height := WizardForm.OuterNotebook.ClientHeight;
{ Put buttons on top of the page (image) }
WizardForm.BackButton.BringToFront()
WizardForm.NextButton.BringToFront();
WizardForm.CancelButton.BringToFront();
{ Add a background image }
BackImage := TBitmapImage.Create(WizardForm);
BackImage.Parent := WizardForm.SelectDirPage;
BackImage.Top := 0;
BackImage.Left := 0;
{ ... }
BackImage.Bitmap.LoadFromFile(...);
end;
But how to do this for uninstall pages? The above works only for the install pages.
CodePudding user response:
Well, actually as the uninstall form is structured the same way as the install wizard, the code for uninstall will be pretty much the same. You just need to move the code to