2014-10-05 26 views
0

Inno Setup脚本有没有包含创建自定义页面和外部.isi文件的代码(我正在使用ISSI加载项)。如果我尝试使用两者,我会收到错误消息“重复标识符:INITIALIZEWIZARD”,因为(很明显)标识符出现在我的主脚本和加载项中。在安装脚本中添加自定义页面和外部.isi文件?

这里(!不完全)是我想用它来创建自定义页面的代码(我已经采取了它几乎完全从创新安装附带的例子:

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应显示的内容。

如果有什么办法可以同时拥有这些东西,我会很感激听到它。

回答

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 

问题解决了。我希望这比我在野外发现的更清楚。

相关问题