Silent install Qt run installer on ubuntu server

前端 未结 12 1187
有刺的猬
有刺的猬 2020-11-30 23:47

I wanted to know if there is a way to do a silent install of the Qt run installer on Ubuntu Server?
I mean by-pass the options of the installer and do a default install?

12条回答
  •  时光说笑
    2020-11-30 23:55

    The script above is old. This should work (and I added retry for download errors)

    function Controller() {
        installer.autoRejectMessageBoxes();
        installer.setMessageBoxAutomaticAnswer("installationError", QMessageBox.Retry);
        installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Retry);
        installer.setMessageBoxAutomaticAnswer("DownloadError", QMessageBox.Retry);
        installer.setMessageBoxAutomaticAnswer("archiveDownloadError", QMessageBox.Retry);
        installer.installationFinished.connect(function() {
            gui.clickButton(buttons.NextButton);
        })
    }
    
    Controller.prototype.WelcomePageCallback = function() {
        // click delay here because the next button is initially disabled for ~1 second
        gui.clickButton(buttons.NextButton, 3000);
    }
    
    Controller.prototype.CredentialsPageCallback = function() {
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.IntroductionPageCallback = function() {
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.TargetDirectoryPageCallback = function()
    {
        //dev is the user in our docker image
        gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("HomeDir") + "/Qt");
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.PerformInstallationPageCallback = function() {
        gui.clickButton(buttons.CommitButton);
    }
    
    Controller.prototype.ComponentSelectionPageCallback = function() {
        function list_packages() {
          var components = installer.components();
          console.log("Available components: " + components.length);
          var packages = ["Packages: "];
          for (var i = 0 ; i < components.length ;i++) {
              packages.push(components[i].name);
          }
          console.log(packages.join(" "));
        }
    
        list_packages();
    
        var widget = gui.currentPageWidget();
    
        console.log(widget);
    
        widget.deselectAll();
        widget.selectComponent("qt.qt5.5130");
        widget.selectComponent("qt.qt5.5130.gcc_64");
        // widget.deselectComponent("");
    
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.LicenseAgreementPageCallback = function() {
        gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.StartMenuDirectoryPageCallback = function() {
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.ReadyForInstallationPageCallback = function()
    {
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.FinishedPageCallback = function() {
        var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
        if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
            checkBoxForm.launchQtCreatorCheckBox.checked = false;
        }
        gui.clickButton(buttons.FinishButton);
    }
    

    run with verbose so you don't have to wait too much time without output

    qt.run -platform minimal --verbose --script ./qt-installer-noninteractive.qs 
    

提交回复
热议问题