1

I have a custom welcome page sample mentioned below which I am trying to create. I need to insert a logo/image in between the text of a custom welcome page.

Welcome Page sample

The sample code and RTF file is available in the below links:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=userdocs:Inno Setup Examples Output

[Files]
Source: Welcome.rtf; Flags: dontcopy

[CustomMessages]
ISCustomPage1_Caption=Welcome to the Installation Wizard
ISCustomPage1_Description=This is a welcome page
[Code]
var
  ISCustomPage1: TWizardPage;
  RichEditViewer1: TRichEditViewer;

procedure InitializeWizard();
var
  RtfName: string;
  Rtf: AnsiString;
begin
  { Creates custom wizard page }
  ISCustomPage1 :=
    CreateCustomPage(
      wpWelcome, CustomMessage('ISCustomPage1_Caption'),
      CustomMessage('ISCustomPage1_Description'));

  { RichEditViewer1 }
  RichEditViewer1 := TRichEditViewer.Create(WizardForm);
  with RichEditViewer1 do
  begin
    Parent := ISCustomPage1.Surface;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(500);
    Height := ScaleY(270);
    ReadOnly := True;
    ScrollBars := ssVertical;

    RtfName := 'Welcome.rtf';
    ExtractTemporaryFile(RtfName);
    if LoadStringFromFile(ExpandConstant('{tmp}\' +RtfName), Rtf) then
    begin
      UseRichEdit := True;
      RTFText  := Rtf;
    end;
  end;
end;

https://pastebin.com/fxQQFsSN

https://filebin.ca/50kCnmRieWC0

Is there a way to achieve this?

Thanks in advance!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
DeeJay007
  • 469
  • 4
  • 30
  • 2
    On possible way is to embed the image into RTF document (though I didn't test it): For a similar question, see [How to add clickable links to custom Inno Setup WelcomeLabel?](https://stackoverflow.com/q/37154573/850848) – Otherwise you will have to stack multiple labels and image controls. – Martin Prikryl Oct 31 '19 at 08:40
  • 2
    Using RTF (as @Martin mentioned) should work. Building your own multiline label with images would be quite painful. – TLama Nov 01 '19 at 01:35
  • Thanks for the inputs guys, I will work it out and let you know how it works. – DeeJay007 Nov 01 '19 at 04:42
  • Hi, Sorry for the delay. I created a custom welcome page and loaded the content from a RTF file for the welcome page. But only the text part is displayed on the page. The image is replaced by empty. I opened the RTF file using MS Word and inserted the picture via Insert --> Pictures. Does this have anything to do with the image file format? I tried with .jpg and .png. – DeeJay007 Nov 04 '19 at 04:34
  • It indeed does not work for me either. So you will probably have to try the stacked controls solution. – Martin Prikryl Nov 04 '19 at 10:01
  • 1
    It seems that the next version of Inno Setup will support images in the RTF files: https://github.com/jrsoftware/issrc/commit/98d77a974caebc9d1e12a6c7c164a8d17e581325 – Martin Prikryl Dec 05 '19 at 12:35

1 Answers1

0

On possible way is to embed the image into RTF document.

For a similar question, see How to add clickable links to custom Inno Setup WelcomeLabel?

You will need Inno Setup 6.0.4 for this.

enter image description here


Or stack multiple labels and image controls.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992