Is there a way for an Inno Setup script to include code that creates custom pages AND an external .isi file (I'm using the ISSI add-in.) If I try to use both, I get the error message that says "Duplicate Identifier: INITIALIZEWIZARD" because (obviously) the identifier occurs both in my main script and in the add-in.
Here (incomplete!) is the code I want to use to create a custom page (I've taken it almost entirely from the examples supplied with Inno Setup:
procedure CreateTheWizardPages;
var
Page: TWizardPage;
RichEditViewer: TRichEditViewer;
vDosFolder: String;
begin
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, 'Existing installation found', 'Read this message!');
RichEditViewer := TRichEditViewer.Create(Page);
RichEditViewer.Width := Page.SurfaceWidth;
RichEditViewer.Height := Page.SurfaceHeight;
RichEditViewer.Parent := Page.Surface;
RichEditViewer.ScrollBars := ssVertical;
RichEditViewer.UseRichEdit := True;
RichEditViewer.RTFText := '{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl{\f0\fswiss\fcharset0 Arial;}}{\colortbl ;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue128;}\viewkind4\uc1\pard\f0\fs20 R\cf1 ead\cf2 This\cf3 Message!\cf0\par}';
RichEditViewer.ReadOnly := True;
end;
end;
end;
procedure InitializeWizard();
begin
CreateTheWizardPages;
end;
What I also want to do (if possible) is us the ISSI addin to put a clickable link on status bar of the wizard, but if I include this code I get the error message:
[ISSI]
#define ISSI_English
#define ISSI_URL
#define ISSI_URLText
#define ISSI_IncludePath "X:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
Plus, of course, some lines in Custom Messages spelling out what ISSI is supposed to display.
If there's any way to have both these things, I'll be grateful to hear it.
To make life easier for anyone else who wants to do this, the answer is here, though a bit obscure:
http://members.home.nl/albartus/inno/ISSI_Functions/ISSI_MyNextButtonClick.htm
To sum this up, if you have an existing section that looks like this:
Do the following:
(1) add this line in [ISSI] block shown above.
(2). Go the end of your Pascal code, and add three lines, including the line that ends the [CODE] block as shown here:
and REMOVE those last two lines from the [ISSI] block, because you're adding them here.
(3) Then, inside your code block, find the lines that read:
and change the first of these lines to read:
Problem solved. I hope this is a clearer statement than the ones I found out there in the wild.