首页 > 解决方案 > 在 inno 设置中更改自定义消息的文本字体

问题描述

有没有办法在 inno 设置中更改自定义消息的颜色?

这是我的测试代码

[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

这是我想改变颜色的地方

关于我如何做到这一点的任何想法

我发现我可以使用消息 ID 更改消息,这样的东西可以用于自定义消息吗?

[Code]
procedure InitializeWizard();
begin
  WizardForm.WelcomeLabel2.Font.Style := [fsBold]; //Bold
  WizardForm.WelcomeLabel2.Font.Color := clRed; // And red colour
end; 

标签: inno-setup

解决方案


在 vanilla Inno Setup 中没有官方方法可以做到这一点。

最好说:只有更改源并重新编译 Inno 设置才有可能,因为将颜色分配给文本被忽略:

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

一些第 3 方扩展(图形安装程序- 我是它的开发人员)或修改后的 Inno Setup 版本允许这样做。


推荐阅读