gpt4 book ai didi

Qt 安装程序框架 : remove radio buttons from uninstaller

转载 作者:行者123 更新时间:2023-12-04 08:07:32 25 4
gpt4 key购买 nike

我为我们的产品创建了一个简单的安装程序,只有一个组件,没有远程存储库管理器。

当我启动卸载程序时,介绍页面显示 3 个单选按钮:

  • 包经理
  • 更新组件
  • 移除所有组件

  • 我只需要第三个,所以我检查了这个文档:

    http://doc-snapshot.qt-project.org/qtifw-master/noninteractive.html

    据我了解并且无法隐藏按钮,我将其添加到我的 install.qs 文件中:
    function Controller()
    {
    }

    Controller.prototype.IntroductionPageCallback = function()
    {
    gui.clickButton(buttons.NextButton);
    }

    这应该会自动单击介绍页面上的下一步,因此它应该直接转到卸载页面。

    什么也没发生,无论我在 Controller 函数中写什么,介绍页面都会显示 3 个单选按钮。我在函数中添加了一些消息框,它们从未被调用。

    有人知道如何解决吗?

    最佳答案

    我想我有 2 个可行的解决方案。

    第一个解决方案,如果您想要一个单页卸载程序:

    您需要像之前开始的那样创建一个 Controller :

    function Controller() {
    if (installer.isUninstaller()) {
    installer.setDefaultPageVisible(QInstaller.Introduction, false);
    installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
    installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
    }
    }

    这将禁用经典安装/卸载工作流程中的所有页面。确保检查您是否处于卸载模式。

    如果你想要一个 2 页的卸载程序:
    function Controller()
    {

    }

    Controller.prototype.IntroductionPageCallback = function()
    {
    if (installer.isUninstaller()) {
    // Get the current wizard page
    var widget = gui.currentPageWidget();
    if (widget != null) {
    // Don't show buttons because we just want to uninstall the software
    widget.findChild("PackageManagerRadioButton").visible = false;
    widget.findChild("UpdaterRadioButton").visible = false;
    widget.findChild("UninstallerRadioButton").visible = false;
    }
    }
    }

    奖金

    在安装程序模式下,默认选择“我接受”许可协议(protocol)。说真的,谁没有?
    Controller.prototype.LicenseAgreementPageCallback = function()
    {
    var widget = gui.currentPageWidget();
    if (widget != null) {
    widget.AcceptLicenseRadioButton.checked = true;
    }
    }

    关于Qt 安装程序框架 : remove radio buttons from uninstaller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27290010/

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