This question already has an answer here:
- Inno Setup - How to display localized RTF text in custom page 1 answer
In another question, I asked about importing an RTF file into InnoSetup to use for a custom wizard page:
Import external RTF file for TRichEditViewer?
Unfortunately, I was only able to figure out how to use the answer so that the external file would be loaded if that file existed on the user's system, and in this case, it doesn't exist on the user's system; it's a file I created to display the installer.
I couldn't figure out how to load the external file so that it would be saved inside the compiled installer script and be visible on someone else's system.
Here is the code I put together. I've experimented with creating separate procedures for loading the string, but haven't been able to figure out how to make it work. I'll be grateful for any help:
procedure CreateTheWizardPages;
var
#ifndef UNICODE
rtfstr: string;
#else
rtfstr: AnsiString;
#endif
var
Page: TWizardPage;
RichEditViewer: TRichEditViewer;
vDosFolder: String;
begin
LoadStringFromFile('c:\dropbox\vdosinst\custom.rtf', rtfstr);
if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\WPDOS.org','vDosDir', vDosFolder) then
begin
if ((DirExists(vDosFolder + '\62Config')) OR (DirExists(vDosFolder + '\61Config')) OR (DirExists(vDosFolder + '\51Config'))) then
begin
Page := CreateCustomPage(wpInfoBefore, 'How to install vDosWP-VDM with an existing vDosWP system', 'Read this message for important information!');
RichEditViewer := TRichEditViewer.Create(Page);
RichEditViewer.Width := Page.SurfaceWidth;
RichEditViewer.Height := Page.SurfaceHeight;
RichEditViewer.Parent := Page.Surface;
RichEditViewer.ScrollBars := ssVertical;
RichEditViewer.UseRichEdit := True;
RichEditViewer.RTFText := rtfstr;
RichEditViewer.ReadOnly := True;
end;
end;
end;
procedure InitializeWizard(); // ISSI_ added to string
begin
CreateTheWizardPages;
end;