Search code examples
inno-setuppascalscript

Inno Setup: Getting Compiler Error "Semicolon (;) Expected" when creating a Boolean or Integer Procedure


Hello I need to create a Boolean Procedure in my Inno Setup Script.

I added my procedure correctly but when try to compile script I am getting error:

Line 2416 , Column 25 , Semicolon (;) Expected.

This is the code I added.

procedure WizardCloser(): Boolean;  <<<THIS IS THE LINE 2416>>>
begin
InitializeWizard;
end;

Thanks for your help.


Solution

  • A procedure does not have a return type.

    You probably wanted to implement a function.


    Other notes:

    • Calling an event function (InitializeWizard) from a custom function seems like a bad idea. The event functions are called by Inno Setup. You should not call them, in general.
    • You have to set the function return value, by setting the Result.