Inno Setup 如果用户不将 'Enter' 替换为其他任何内容,则禁用下一步按钮

Inno Setup Disable Next Button if user does not replace 'Enter' with anything else

如果 'Enter' 未被其他任何内容覆盖,我如何阻止用户继续前进。除了 'Enter',我还可以将其设为空白。无论如何,用户必须在其中放置一些内容才能启用“下一步”按钮。这是欢迎页面之后的第二个 window,我需要用它来完成此操作。

[Code]

var
  SettingEnv: TInputQueryWizardPage;

procedure InitializeWizard;
begin
  SettingEnv := CreateInputQueryPage(wpWelcome,
    'User Input', '', 'Enter SettingEnv, then click Next.');
  SettingEnv.Add('', False);
  SettingEnv.Values[0] := 'Enter';
end;

我建议你使用:

function NextButtonClick(CurPageID: Integer): Boolean;

来自documentation

Called when the user clicks the Next button. If you return True, the wizard will move to the next page; if you return False, it will remain on the current page (specified by CurPageID).

Note that this function is called on silent installs as well, even though there is no Next button that the user can click. Setup instead simulates "clicks" on the Next button. On a silent install, if your NextButtonClick function returns False prior to installation starting, Setup will exit automatically.

有一个与类似问题相关的 ,其中包含代码。这会有所帮助。