2017-07-30 84 views
0

我试图禁用动态欢迎页面: 这里有不同的选择,我试图动态禁用欢迎页面

[SETUP] 
DisableWelcomePage={code:ShouldSkipAutorun} 
... 
[CODE] 
function ShouldSkipAutorun(Default: string):boolean; 
begin 
    ... 
// will return true or false on whether to disable it or not 
end; 

错误:DisableWelcomePage“[设置]部分指令的价值‘’无效”

接下来我尝试使用shouldskippage,但文档说

This event function isn't called for the wpWelcome, wpPreparing, and wpInstalling pages, nor for pages that Setup has already determined should be skipped (for example, wpSelectComponents in an install containing no components

任何帮助吗?

+0

的可能的复制[Inno Setup的条件跳过结束页](https://stackoverflow.com/questions/40084003/inno-setup-有条件地跳了精加工页) –

回答

2

使用ShouldSkipPage功能in inno。

在[Setup]部分设置DisableWelcomePage默认值为no

[Setup] 
DisableWelcomePage=no 

修改你的[代码]部分如下

[CODE] 
function ShouldSkipAutorun():boolean; 
begin 
    Result:=/** add you result here (TRUE or FALSE) **/; 
end; 

function ShouldSkipPage(PageID: Integer): Boolean; 
begin 
    Result := False;  
    if PageID = wpWelcome then 
    begin 
    Result := ShouldSkipAutorun; 
    end; 
end;