Search code examples
inno-setuppascalscript

Prompt for Inno Setup task based on results of script function


With Inno Setup, I have a task which I want to be conditional based on the results of a Pascal Script function. If the function returns true, the task will be displayed and the user can either check or un-check it. Otherwise, the task will not be shown.


Solution

  • You are looking for the Check parameter:

    [Tasks]
    Name: mytask; Description: "My Task"; Check: IsTaskValid
    
    [Code]
    
    function IsTaskValid: Boolean;
    begin
      Result := { Your decision logic };
    end;