inno-setuppascalscriptmsgbox

Use MsgBox in Inno Setup to ask questions before Installation


How to make installer to ask a question before opening the installer?

For Example:
It will ask "Are You Over 18?" then user can select whether "Yes" or "No".
If user selects "Yes", installer will open. if user selects "No", installer will close automatically.

I would like to use MsgBox feature, if I could.


Solution

  • Call the MsgBox from InitializeSetup event function:

    [Code]
    function InitializeSetup(): Boolean;
    begin
      Result := (MsgBox('Are You Over 18?', mbConfirmation, MB_YESNO) = IDYES);
    end;
    

    Or as @KenWhite commented, use a custom wizard page. You can use CreateInputOptionPage function for that.