inno-setup - wpSelectComponents 上的 Inno Setup 文本

标签 inno-setup

正在尝试在 wpSelectComponents 表单上放置一些文本。

我可以在这个 WizardForm 上显示一个按钮,我可以显示一个面板(通过将表面声明为 WizardForm 和 visible=False 直到 CurrPageId = wpSelectComponents)但我似乎无法显示一条短信。

我可以在面板内显示文本(作为标题)但我不能使用 chr(13) 来创建换行符。

是否可以在预定义的向导页面上显示文本? (两个简短的段落)。

最佳答案

如果您要显示带有按钮的面板和带有多行文本的标签,则只能显示在特定页面的内容下方(在本例中为选择组件页面) ,您可能会从以下脚本中获得灵感:

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

[Components]
Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
Name: "help"; Description: "Help Files"; Types: full
Name: "help\english"; Description: "English"; Types: full
Name: "help\dutch"; Description: "Dutch"; Types: full

[Code]
var
  Panel: TPanel;

procedure FuncButtonClick(Sender: TObject);
begin
  MsgBox('You did it!', mbInformation, MB_OK);
end;

procedure InitializeWizard;
var  
  DescLabel: TLabel;
  FuncButton: TNewButton;
  ContentHeight: Integer;
begin
  ContentHeight := WizardForm.OuterNotebook.Top + 
    WizardForm.OuterNotebook.Height;

  Panel := TPanel.Create(WizardForm);
  Panel.Parent := WizardForm;
  Panel.Left := 4;
  Panel.Top := ContentHeight + 4;
  Panel.Width := WizardForm.BackButton.Left - 8;
  Panel.Height := WizardForm.ClientHeight - ContentHeight - 8;
  Panel.Visible := False;

  FuncButton := TNewButton.Create(WizardForm);
  FuncButton.Parent := Panel;
  FuncButton.Left := (Panel.Height - FuncButton.Height) div 2;
  FuncButton.Top := (Panel.Height - FuncButton.Height) div 2;
  FuncButton.Caption := 'Click me!';
  FuncButton.OnClick := @FuncButtonClick; 

  DescLabel := TLabel.Create(WizardForm);
  DescLabel.Parent := Panel;
  DescLabel.AutoSize := True;
  DescLabel.Caption := 'Hello,' #13#10 + 'I''m your label! :-)';
  DescLabel.Left := FuncButton.Left + FuncButton.Width + 8;
  DescLabel.Top := (Panel.Height - DescLabel.Height) div 2;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  Panel.Visible := CurPageID = wpSelectComponents;
end;

结果如下:

enter image description here

关于inno-setup - wpSelectComponents 上的 Inno Setup 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16500010/

相关文章:

windows - 为什么我的 Delphi 6 程序在安装时仅在少数 Windows 7 系统 (InnoSetup) 上触发管理员权限请求?

java - 如何在 NetBeans 中设置 Inno Setup 插件

inno-setup - 在 Inno setup 编译器中安装应用程序之前,如何检查是否安装了 mysql 服务器

inno-setup - 获取临时文件夹

batch-file - 我如何获得 Inno 安装程序卸载程序脚本来删除服务

deployment - JavaFX 桌面部署为 EXE 文件

windows - 使用 innosetup 在开始菜单中创建快捷方式

powershell - 在 Inno Setup 编译器中运行 [Code] 或 PowerShell 脚本

inno-setup - 即使在指定 ArchitecturesInstallIn64BitMode 后,Inno Setup 也会以 32 位启动

inno-setup - 在 Inno Setup 脚本中使用 Inno Setup 编译器命令行上指定的路径/值