user3715645
user3715645

Reputation: 71

Terminate setup on 32-bit Windows in Inno Setup

I'm using Inno Setup.

Can someone please tell me how to terminate the setup, if the Windows version is 32-bit?

Or to be more specific, when the setup starts, the code checks if the Windows Version is 32-bit and displays a warning then cancels the setup.

What’s the command to terminate the setup completely?

I'm using the following procedure

procedure CheckWindows;
begin
  if not IsWin64 then
  begin
    MsgBox('Error:The Windows version is 32bit',mbError,MB_OK);
    WizardForm.Close;
  end;
end;

It does give the warning message but then it allows the user to continue if they want.

How do I completely terminate the installation?

Upvotes: 4

Views: 1270

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202514

Just return False from the InitializeSetup, when you detect a 32-bit system (using the IsWin64 function).

function InitializeSetup(): Boolean;
begin
  Result := True;

  if not IsWin64 then
  begin                     
    SuppressibleMsgBox(
      'Error:The Windows version is 32bit', mbError, MB_OK, IDOK);
    Result := False;
  end;
end;

See also Exit from Inno Setup installation from [Code].


Or simply use the ArchitecturesAllowed directive.

See also:

Upvotes: 6

Related Questions