Terminate setup on 32-bit Windows in Inno Setup

前端 未结 1 1901
旧巷少年郎
旧巷少年郎 2021-01-13 20:50

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 star

1条回答
  •  借酒劲吻你
    2021-01-13 21:26

    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.

    0 讨论(0)
提交回复
热议问题