【问题标题】:Terminate setup on 32-bit Windows in Inno Setup在 Inno Setup 中终止 32 位 Windows 上的设置
【发布时间】:2014-06-25 22:05:26
【问题描述】:

我正在使用 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;

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

如何完全终止安装?

【问题讨论】:

    标签: inno-setup


    【解决方案1】:

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

    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;
    

    另见Exit from Inno Setup installation from [Code]。


    或者直接使用ArchitecturesAllowed directive。

    另见:

    【讨论】:

      猜你喜欢
      • 2011-09-14
      • 2020-08-23
      • 1970-01-01
      • 2015-09-21
      • 1970-01-01
      • 2011-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多