Custom Welcome and Finished page with stretched image in Inno Setup

风流意气都作罢 提交于 2019-11-29 15:16:22

问题


I have created an image that I want to appear over whole Welcome and Finished pages of the installer, with only the bottom buttons showing.

The Welcome wizard page should be like:

The Finished page like:

I'm getting

Please help! Thanks in advance😊


回答1:


First, note that the Welcome page is disabled by default since Inno Setup 5.5.7. If you really want it, you have to enable it using DisableWelcomePage=no.

To display images only on the pages, you need to do:

  • Stretch WizardBitmapImage (Welcome) and WizardBitmapImage2 (Finished) over their respective parent pages.
  • Hide the other components, mainly the labels.
  • Make sure that the installer never needs to restart the machine, otherwise you get a restart prompt over the image.
  • Make sure you do not have any postinstall entries in the [Run] section, for the same reason.
[Setup]
DisableWelcomePage=no
WizardImageFile=godfather.bmp

[Code]

procedure InitializeWizard();
begin
  { Welcome page }
  { Hide the labels }
  WizardForm.WelcomeLabel1.Visible := False;
  WizardForm.WelcomeLabel2.Visible := False;
  { Stretch image over whole page }
  WizardForm.WizardBitmapImage.Width := WizardForm.WizardBitmapImage.Parent.Width;

  { Finished page }
  { Hide the labels }
  WizardForm.FinishedLabel.Visible := False;
  WizardForm.FinishedHeadingLabel.Visible := False;
  { Stretch image over whole page }
  WizardForm.WizardBitmapImage2.Width := WizardForm.WizardBitmapImage2.Parent.Width;
end;



来源:https://stackoverflow.com/questions/34705492/custom-welcome-and-finished-page-with-stretched-image-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!