Inno Setup - Image as installer background

2019-01-25 00:25发布

问题:

Image as installer background. How to do that with inno 5.5.9?

回答1:

I do not think this is possible in Inno Setup proper. Maybe is some Inno Setup clone.

The problem is that all labels in Inno Setup are TStaticText, which is not transparent. So you would have to replace all with TLabel. And there's a lot of them. And they are managed by Inno Setup. So you would somehow have to continuously update the new TStaticText's to the values set to original TLabel's by the Inno Setup. It may not even be possible.


So actually, it's possible to create a page like in your question. But only because there are no standard Inno Setup labels. But you cannot hide all of them.

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;

Similar questions:

  • Displaying a background image above "footer" only:
    How to hide the main panel and show an image over the whole page?
  • Displaying a background image between "header" and "footer" only: Image covering whole page in Inno Setup.


回答2:

Maybe you can try Graphical Installer for Inno Setup which is specially designed for this purpose.

With it you can create cool looking installers and they support changing background (this picture is from last project for Shadow Tactics game) mod:

I am developer of this project (commercial) so if you need more info feel free to ask.



标签: inno-setup