在 Inno Setup 中终止 32 位 Windows 上的安装

use*_*645 4 inno-setup pascalscript

我正在使用 Inno Setup。

\n\n

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

\n\n

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

\n\n

完全终止安装程序的命令是什么\xe2\x80\x99?

\n\n

我正在使用以下过程

\n\n
procedure CheckWindows;\nbegin\n  if not IsWin64 then\n  begin\n    MsgBox(\'Error:The Windows version is 32bit\',mbError,MB_OK);\n    WizardForm.Close;\n  end;\nend;\n
Run Code Online (Sandbox Code Playgroud)\n\n

它确实给出了警告消息,但随后它允许用户根据需要继续。

\n\n

如何彻底终止安装?

\n

Mar*_*ryl 6

当您检测到 32 位系统时,只需False从 中返回(使用函数)。InitializeSetupIsWin64

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;
Run Code Online (Sandbox Code Playgroud)

另请参阅从 [Code] 退出 Inno Setup 安装


或者直接使用ArchitecturesAllowed指令

也可以看看: