在Inno Setup中终止在32位Windows上的安装 [英] Terminate setup on 32-bit Windows in Inno Setup

查看:83
本文介绍了在Inno Setup中终止在32位Windows上的安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Inno Setup.

I'm using Inno Setup.

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

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

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

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?

我正在使用以下过程

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.

如何完全终止安装?

推荐答案

只需从 InitializeSetup ,当您检测到32位系统时(使用 IsWin64函数).

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;

另请参见从[code] 的Inno Setup Installation中退出.

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

或仅使用 ArchitecturesAllowed指令.

Or simply use the ArchitecturesAllowed directive.

另请参阅:

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

这篇关于在Inno Setup中终止在32位Windows上的安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆