问题
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 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?
I'm using the following procedure
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.
How do I completely terminate the installation?
回答1:
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.
来源:https://stackoverflow.com/questions/24419390/terminate-setup-on-32-bit-windows-in-inno-setup