Inno Setup脚本是否可以包含用于创建自定义页面和外部.isi文件的代码(我正在使用ISSI加载项。)如果我尝试同时使用这两种方法,则会收到错误消息,指出“重复标识符:INITIALIZEWIZARD”,因为(显然)标识符同时出现在我的主脚本和加载项中。
这里(不完整!)是我要用来创建自定义页面的代码(我几乎完全从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;
[我还想做的(如果可能的话,是我们将ISSI插件添加到向导的状态栏上,但是如果我包含此代码,则会收到错误消息:
[ISSI]
#define ISSI_English
#define ISSI_URL
#define ISSI_URLText
#define ISSI_IncludePath "X:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
加上,当然,“自定义消息”中的某些行会拼写ISSI应该显示的内容。
如果有办法同时拥有这两种东西,我将不胜感激。
[为了使想这样做的人生活更轻松,答案就在这里,虽然有点晦涩:
http://members.home.nl/albartus/inno/ISSI_Functions/ISSI_MyNextButtonClick.htm
总结起来,如果您已有一个看起来像这样的部分:
[ISSI]
#define ISSI_English
#define ISSI_URL
#define ISSI_URLText
#define ISSI_IncludePath "X:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
执行以下操作:
((1)在上面显示的[ISSI]块中添加此行。
#define ISSI_UseMyInitializeWizard
(2)。在Pascal代码的末尾,添加三行,包括结束[CODE]块的行,如下所示:
[/CODE]
#define ISSI_IncludePath "X:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
并从[ISSI]块中删除最后两行,因为您要在此处添加它们。
((3)然后,在您的代码块中,找到以下行:
procedure InitializeWizard();
...
end;
并将这些行的第一行更改为:
procedure ISSI_InitializeWizard(); // ISSI_ added to string
问题已解决。我希望这是一个比我在野外发现的声明更清晰的声明。