0

I am trying to disable welcome page dynamically : here are different option i tried

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

error: "Value of [Setup] section directive "DisableWelcomePage" is invalid"

next I tried using shouldskippage but documentation says

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

any help?

unknown.prince
  • 710
  • 6
  • 19
  • Possible duplicate of [Inno Setup conditionally skip the Finished page](https://stackoverflow.com/questions/40084003/inno-setup-conditionally-skip-the-finished-page) – Martin Prikryl Aug 01 '17 at 05:19
  • And for the syntax error, no idea? The error is also here on problems without workaround/better practice. Ex :`Parameters: "firewall set portopening protocol=TCP port={code:GetServerPort}` – Sandburg Feb 08 '19 at 13:29

1 Answers1

3

Use ShouldSkipPage function in inno.

Set DisableWelcomePage default value to no in [Setup] section.

[Setup]
DisableWelcomePage=no

Modify your [Code] section as below

[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;
RN92
  • 1,380
  • 1
  • 13
  • 32