inno-setup - 为 TRichEditViewer 导入外部 RTF 文件?

标签 inno-setup rtf

我正在使用 TRichEditViewer在 Inno Setup 脚本中的自定义页面上。是否可以将外部 RTF 文件读入变量,并将该变量用作查看器的内容?或者我是否必须在脚本中保留实际的 RTF 代码?

感激地收到任何帮助。

最佳答案

您应该可以使用 LoadStringFromFile阅读 RTF文件转换成字符串。来自创新documentation :

Prototype:

function LoadStringFromFile(const FileName: String; var S: AnsiString): Boolean;


描述:

Loads the specified binary or non Unicode text file into the specified string. Returns True if successful, False otherwise.



您应该能够定义一个 string ANSI Inno Setup 或 AnsiString 的类型变量使用以下内容为 Unicode Inno Setup 键入变量:
var
#ifndef UNICODE
  rtfstr: string;
#else
  rtfstr: AnsiString;
#endif
然后在代码中:
LoadStringFromFile('filenamehere.rtf', rtfstr);
然后使用类似于下面的代码。在这个例子中假设 oRichViewerTRichEditViewer目的:
oRichViewer.UseRichEdit := True;
oRichViewer.RTFText := rtfstr;
这应该具有放置 rtfstr 的效果我们之前从文件加载到 TRichEditViewer .

关于inno-setup - 为 TRichEditViewer 导入外部 RTF 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26209200/

相关文章:

inno-setup - 创新设置: pack folder with all subfolders

inno-setup - 使用先前安装的语言而不询问 Inno Setup?

inno-setup - 我需要有关 inno setup 自定义页面的帮助

iOS:带有 RTF 的警报 View (粗体、URL 等)

c# - 以编程方式在 FlowDocument 中创建水平线

WPF:允许用户调整 RichTextBox 中图像的大小

inno-setup - Inno Setup 无法在 AppVeyor 上使用掩码找到图像文件

installation - 如何使用一个 Inno Setup 脚本安装两个产品?

annotations - 寻找在 Eclipse RCP 应用程序中使用的 RTF 编辑器

python - 使用 python 的 doc、docx 或 rtf 文件中的页数