我试图通过使用 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]节指令"DisableFinishedPage"的值无效.
Value of [Setup] section directive "DisableFinishedPage" is invalid.
因此,我认为即使其他 [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设置中的可选组件跳过自定义页面.
更多推荐
Inno Setup有条件地跳过“完成"页面
发布评论