Use MsgBox in Inno Setup to ask questions before Installation

87 Views Asked by At

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.

1

There are 1 best solutions below

0
Martin Prikryl On BEST ANSWER

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.