在Inno Setup中终止32位Windows上的设置

时间:2014-06-25 22:05:26

标签: inno-setup

我正在使用Inno Setup。

如果Windows版本是32位,有人可以告诉我如何终止设置吗?

或者更具体地说,当安装程序启动时,代码会检查Windows版本是否为32位并显示警告然后取消设置。

完全终止设置的命令是什么?

我正在使用以下程序

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

确实会发出警告信息,但是如果需要,它会允许用户继续。

如何完全终止安装?

1 个答案:

答案 0 :(得分:3)

当您检测到32位系统时(使用InitializeSetup),只需从IsWin64 function返回False

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;

另见Exit from Inno Setup Installation from [code]

或者只使用ArchitecturesAllowed directive

另见:

相关问题