Inno Setup有条件地跳过“完成"页面

编程入门 行业动态 更新时间:2024-10-26 13:19:06
本文介绍了Inno Setup有条件地跳过“完成"页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图通过使用 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有条件地跳过“完成"页面

本文发布于:2023-11-25 03:54:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628214.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有条件   跳过   页面   Inno   Setup

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!