0

有没有办法让 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 应该显示的内容。

如果有任何方法可以同时拥有这两种东西,我会很感激听到它。

4

1 回答 1

0

为了让其他想要这样做的人生活更轻松,答案就在这里,虽然有点模糊:

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

问题解决了。我希望这是一个比我在野外发现的更清晰的陈述。

于 2014-10-06T02:39:48.180 回答