gpt4 book ai didi

inno-setup - 将 Next 按钮更改为 Install with DisableReadyPage 指令的官方 Inno Setup 代码不起作用

转载 作者:行者123 更新时间:2023-12-05 03:12:03 25 4
gpt4 key购买 nike

我使用的代码来自: http://www.jrsoftware.org/ishelp/index.php?topic=setup_disablereadypage

当使用 DisableReadyPage 指令禁用“Ready”页面时,它应该将 Next 按钮标题更改为 Install

[Setup]
DisableReadyPage=yes

[Code]
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectProgramGroup then
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
else
WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
end;

但它不会更改 Next 按钮标题。

enter image description here

最佳答案

正如代码的描述所说:

For example, if the new last pre-installation wizard page is the Select Program Group page: ...

在您的情况下,最后的预安装页面不是选择程序组 页面。这是选择目标位置页面。可能是因为您将 DisableProgramGroupPage 设置为 no,或者您已将其设置为 auto 并且您正在升级(应用程序已安装)。

如果您将 DisableProgramGroupPage 设置为 no,解决方案很简单,因为 Select Destination Location 页面始终位于最后。只需将 wpSelectProgramGroup 替换为 wpSelectDir

[Code]
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
else
WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
end;

使用auto(默认),您不会在升级时得到任何选择程序组选择目标位置,但您得到Ready to Install 即使使用 DisableProgramGroupPage(因为在安装之前不会有任何其他页面)。您可以使用该事实为选择程序组页面(用于全新安装)和准备安装(用于升级)使用安装

他们代码的另一个问题是您应该在“完成”页面 (wpFinished) 上获得一个完成 按钮。他们的代码不关心什么。

完整的解决方案是:

procedure CurPageChanged(CurPageID: Integer);
begin
// On fresh install the last pre-install page is "Select Program Group".
// On upgrade the last pre-install page is "Read to Install"
// (forced even with DisableReadyPage)
if (CurPageID = wpSelectProgramGroup) or (CurPageID = wpReady) then
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
// On the Finished page, use "Finish" caption.
else if (CurPageID = wpFinished) then
WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish)
// On all other pages, use "Next" caption.
else
WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
end;

如果您有其他页面,例如任务页面,您将不得不相应地更改代码。

关于inno-setup - 将 Next 按钮更改为 Install with DisableReadyPage 指令的官方 Inno Setup 代码不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35104265/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com