Terminate setup on 32-bit Windows in Inno Setup

北城以北 提交于 2020-01-11 05:45:12

问题


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?


回答1:


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, MB_OK);
    Result := False;
  end;
end;

See also Exit from Inno Setup Installation from [code].


Or simply use the ArchitecturesAllowed directive.

See also:

  • Does ArchitecturesAllowed Inno Setup directive concern CPU architecture or operating system architecture?
  • Show a custom message for unsupported architectures.


来源:https://stackoverflow.com/questions/24419390/terminate-setup-on-32-bit-windows-in-inno-setup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!