1

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:

Value of [Setup] section directive "DisableFinishedPage" is invalid.

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?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Robert Wigley
  • 1,917
  • 22
  • 42

1 Answers1

1

The DisableFinishedPage directive does not support scripted constants.

Use the ShouldSkipPage event function instead:

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  Result := False;

  if PageID = wpFinished then
  begin
    Result := IsTaskSelected('AutoFinish');
  end;
end;

See also Skipping custom pages based on optional components in Inno Setup.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992