Qt Installer non-interactive



  • Hey all! I am trying to install Qt from a .run file non-interactive. I have a script that doesn't quite work at the very end. I want to uncheck the box for running Qt creator and finish the install -- the only problem is Qtcreator still opens when i try to program the checkbox to uncheck. I am running the installer like this:

    ./qt-opensource-linux-x64-5.6.2.run --verbose --script qt-installer-noninteractive.qs

    Side note - if anyone can tell me how to run this whole thing without using X server at all I would be extremely grateful! I'd like to just run the script without the installer connecting to X (headless). Assume I am installing on an Ubuntu Server installation with no GUI! Some dude on stackoverflow mentioned using -platform minimal but it didn't work when I tried. This isn't critical, as I can technically install this by forwarding an X socket to a host machine, but this is such a silly workaround.

    Anyway, here is my script source:

    // Emacs mode hint: -*- mode: JavaScript -*-
    
    // EVERYTHING DOCUMENTED HERE http://doc.qt.io/qtinstallerframework/noninteractive.html#start-menu-directory-page
    
    function Controller() {
        installer.autoRejectMessageBoxes();
        installer.installationFinished.connect(function() {
            gui.clickButton(buttons.NextButton);
        })
    }
    
    // WELCOME -> NEXT
    Controller.prototype.WelcomePageCallback = function() {
        gui.clickButton(buttons.NextButton);
    }
    
    // LOGIN -> SKIP
    Controller.prototype.CredentialsPageCallback = function() {
        gui.clickButton(buttons.NextButton);
        // gui.clickButton(buttons.SkipButton);
    }
    
    // SETUP -> NEXT
    Controller.prototype.IntroductionPageCallback = function() {
        gui.clickButton(buttons.NextButton);
    }
    
    // INSTALLATION FOLDER -> NEXT
    Controller.prototype.TargetDirectoryPageCallback = function()
    {
        gui.clickButton(buttons.NextButton);
    }
    
    // SELECT COMPONENTS -> NEXT
    Controller.prototype.ComponentSelectionPageCallback = function() {
        var widget = gui.currentPageWidget();
    
        widget.selectAll();
        //widget.deselectAll();
    
        //widget.selectComponent("qt.55.gcc_64");
        //widget.selectComponent("qt.55.qtquickcontrols");
        // widget.deselectComponent("qt.tools.qtcreator");
        // widget.deselectComponent("qt.55.qt3d");
        // widget.deselectComponent("qt.55.qtcanvas3d");
        // widget.deselectComponent("qt.55.qtlocation");
        // widget.deselectComponent("qt.55.qtquick1");
        // widget.deselectComponent("qt.55.qtscript");
        // widget.deselectComponent("qt.55.qtwebengine");
        // widget.deselectComponent("qt.extras");
        // widget.deselectComponent("qt.tools.doc");
        // widget.deselectComponent("qt.tools.examples");
    
        gui.clickButton(buttons.NextButton);
    }
    
    // LICENSE AGREE -> RADIO IAGREE -> NEXT
    Controller.prototype.LicenseAgreementPageCallback = function() {
        gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
        gui.clickButton(buttons.NextButton);
    }
    
    Controller.prototype.ReadyForInstallationPageCallback = function() {
        gui.clickButton(buttons.CommitButton);
    }
    
    // Completing the Qt 5.6.2 Wizard Page (???) -> Uncheck "Launch Qt Creator" checkbox -> FINISH
    Controller.prototype.FinishedPageCallback = function() {
        // THIS LINE DOESN'T SEEM TO WORK -- QTCREATOR OPENS
        gui.currentPageWidget().RunItCheckBox.setChecked(false);
        gui.clickButton(buttons.FinishButton);
    }
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    IIRC, there was a thread about that on the interest mailing list and there's QTIFW-166 talking about that.

    Hope it helps



  • @SGaist -- Thank you for linking to QTIFW-166. This does appear to be talking about these issues. Sadly, the end solution they cite is precisely what doesn't work. '-platform' is an unrecognized argument with the version of the installer 'qt-opensource-linux-x64-5.6.2.run'. This is a seperate issue from the script not being able to uncheck 'Run Qt Creator' in the installer GUI, of course.

    My first guess is that the feature doesn't exist in the installer version I've got. I am wondering -- how do I check the version of the installer framework is being used with any given package? Maybe the installer framework version is too old on my 5.6.2.run file. Not that that would help much, since I am locked to this Qt version for my needs and I need a method of installing it over commandline without X server and without user interactivity.

    • AD

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.