首页 > 解决方案 > 如何在 InnoSetup 中的 StatusMsg 中换行?

问题描述

Filename: "{app}\program.exe"; Parameters: -d; \
  StatusMsg: "How to put line break after this sentence? This sentence should be on new line."; \
  Flags: runascurrentuser;

我试过了+ #13#10 +%n但他们没有用。

标签: inno-setupinno-setup-v6

解决方案


状态消息行只有一行(因此虽然您可以在消息中插入新行,但不会显示第二行)。

第二行是为文件名保留的(安装文件时)。

您可以像这样滥用文件名行:

[Run]
Filename: "{app}\program.exe"; Parameters: "-d"; \
  StatusMsg: "How to put line break after this sentence?"; Flags: runascurrentuser; \
  BeforeInstall: SetFileName('This sentence should be on new line.'); \
  AfterInstall: SetFileName('')
[Code]

procedure SetFileName(FileName: string);
begin
  WizardForm.FilenameLabel.Caption := FileName;
end;

在此处输入图像描述


另一个(更复杂的)选项是暂时使状态行更高(多行)。


推荐阅读