1

Is there a way to change the color of a custom message in inno setup?

here is my test code

[Setup]
AppName=My Program
AppVersion=1.5
WizardStyle=modern
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output
CreateAppDir=False

[Components]
Name: "program"; Description: "{cm:mymessage}"

[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"

[CustomMessages]
mymessage=this is my message

here is where I would like to change color

any idea on how I might accomplish this

I found I can change messages using message id, could something like this be used for custom messages?

[Code]
procedure InitializeWizard();
begin
  WizardForm.WelcomeLabel2.Font.Style := [fsBold]; //Bold
  WizardForm.WelcomeLabel2.Font.Color := clRed; // And red colour
end; 
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • See also [Inno Setup - Change a task description label's color and have a line break](https://stackoverflow.com/q/35817280/850848) – *"I'm pretty sure there's no way to change a color of one specific task. All you can do is to create a separate `TNewCheckListBox` for each group of tasks that should have a different color (and set the color using its `.Font.Color` property)."* – It's about tasks, but they use the same visual component as Inno Setup components. – Martin Prikryl Apr 20 '20 at 07:31

1 Answers1

1

There is no official way how to do that in vanilla Inno Setup.

Better to say: it is possible only with changing the sources and recompiling the Inno Setup because assigning the color to text is ignored:

  WizardForm.ComponentsList.Font.Color := clRed;
  WizardForm.ComponentsList.Color := clBlue;

Some 3rd party extensions (Graphical Installer - I am it's developer) or modified Inno Setup version allows that.

Slappy
  • 5,250
  • 1
  • 23
  • 29