问题描述
我试图通过使用 Task
有条件地跳过完成"页面,以允许用户选择是否要设置自动完成".我尝试了以下方法:
I am trying to conditionally skip the Finished page through use of a Task
to allow the user the choice of whether they want to have Setup 'Auto-Finish'. I have tried the following:
[Setup]
DisableFinishedPage={code:GetAutoFinishStatus}
[Tasks]
Name: "AutoFinish"; Description: "Auto-Finish Installation"; \
GroupDescription: "Post Installation Options"; Flags: unchecked; Components: MyApp
[Code]
function GetAutoFinishStatus(Param: String): String;
begin
if IsTaskSelected('AutoFinish') then
Result := 'yes';
end;
但是,在编译时,我得到了:
But, when compiling, I get:
因此,我认为即使其他 [Setup]
指令可以接受,该指令也不通过代码接受条件值?还有另一种方法可以实现这一目标,还是我做错了什么?
I therefore assume that this directive does not accept a conditional value through code, even though other [Setup]
directives do? Is there another way to achieve this, or am I doing something wrong?
推荐答案
DisableFinishedPage 指令不支持脚本常量.
The DisableFinishedPage
directive does not support scripted constants.
使用 ShouldSkipPage
事件函数代替:
Use the ShouldSkipPage
event function instead:
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
if PageID = wpFinished then
begin
Result := IsTaskSelected('AutoFinish');
end;
end;
这篇关于Inno Setup有条件地跳过“完成"页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!