inno-setup - 修改Inno Wizard Pages的尺寸、背景图片等

标签 inno-setup

我有这部分代码可以调整我的欢迎页面,但完成的页面仍然是默认的 Inno 页面,侧面有丑陋的向导图片。我想对完成的页面执行与欢迎相同的操作

[Code]
    procedure InheritBoundsRect(ASource, ATarget: TControl);
    begin
      ATarget.Left := 210;
      ATarget.Top := ASource.Top;
      ATarget.Width := 295;
      ATarget.Height := ASource.Height;
    end;

    procedure InitializeWizard;
    var
      TopWelcomeLabel: TLabel;
      BottomWelcomeLabel: TLabel;
    begin

      WizardForm.WizardBitmapImage.Align := alClient;
      WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('Q:\Inno\wizardimages\new\bmp.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;

编辑解决方案:

现在在下面的人的帮助下,这是新代码,看起来效果很好

[Code]
    procedure InheritBoundsRect(ASource, ATarget: TControl);
    begin
      ATarget.Left := 210;
      ATarget.Top := ASource.Top;
      ATarget.Width := 295;
      ATarget.Height := ASource.Height;
    end;

    procedure InitializeWizard;
    var
      TopWelcomeLabel: TLabel;
      BottomWelcomeLabel: TLabel;
    begin

      WizardForm.WizardBitmapImage.Align := alClient;
      WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('bmp.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;

      WizardForm.WizardBitmapImage2.Align := alClient;


//Stackoverflow changes start here...

      WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile('bmp.bmp');

      WizardForm.FinishedLabel.Left := 210;
      WizardForm.FinishedLabel.Width := 265;

      WizardForm.FinishedHeadingLabel.Left := 210;
      WizardForm.FinishedHeadingLabel.Width := 265

      WizardForm.RunList.Left := 210;
    end;

最佳答案

最终页面中的组件名称是:

  • 成品标签
  • 完成的标题标签
  • WizardBitmapImage2

我已经在这张图片中标记了它们:

enter image description here

关于inno-setup - 修改Inno Wizard Pages的尺寸、背景图片等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22460099/

相关文章:

inno-setup - 用单选按钮替换安装类型下拉列表

inno-setup - Inno Setup Error "Text is not inside a section."升级后

inno-setup - Inno 安装编译器 : How to edit INI file and replace a value with {app} constant

inno-setup - Inno Setup 中的 DiskSpaceLabel 和 ComponentsDiskSpaceLabel 有什么区别?

inno-setup - 具有三个按钮和三个结果的 Inno Setup MsgBox

string - 在 Inno Setup 中使用 Pascal 脚本从配置文件中查找和读取特定字符串

inno-setup - 如何从批处理或 Inno Setup 脚本中获取 Inno Setup 版本号?

inno-setup - 如何在安装过程中记录用户输入,以便在卸载过程中使用?

inno-setup - 使用 Inno Setup 更新 Windows 资源管理器外壳扩展

windows-services - 如何使用 inno setup 运行 windows 启动服务?