Inno 设置:自定义 类

Inno Setup: Custom classes

Inno Setup 是否允许在 'type' 关键字之后创建自己的 classes? 我试图从 TBitmapImage 继承:

[Code]
type
    TBitmapButton = class(TBitmapImage)
        property OnHoverImage: TAlphaBitmap;
        procedure Hovering(IsHovered: Boolean);
    end;

但是编译器说 'Identifier expected' 在 class 声明的开头。

我认为对您的问题的简短回答是。根据 InnoSetup 网站上关于类似问题的帮助主题:

http://news.jrsoftware.org/news/innosetup.code/msg25634.html

部分内容是:

RemObjects Pascal doesn't support custom ([Code] created) classes.

所以我不认为你可以做你想做的事。上面的讨论线程提到了一个可能的解决方法:

You can define a "record" containing all of the desired fields, and an "array of" your record type to create a dynamically-expandable indexed list of them.

You can't define methods or constructors/destructors directly attached to these, but you can define loose procedures/functions that do the equivalent.

That's as close to custom classes as you're going to get in ROPS.

我不知道这是否足以满足您的需求。

如果您需要研究 InnoSetup 代码功能,这里有很棒的资源:

http://www.jrsoftware.org/newsgroups.php#search