4

A recent update to the metadata pulled by the Qt online installer has made some significant changes which have broken my installation script for Windows CI/CD.

I've solved one issue (bypassing the statistics collection screen - see DynamicTelemetryPluginFormCallback below), but I'm having trouble with another issue. On the "Select Components" screen, the default selected package category is now just LTS, and there doesn't seem to be a way to change it from the script. This means I can't install the latest Qt version, Qt 5.13.1. I can't use 5.12, since it doesn't have the Qt Controls 2 SplitView, which I am using in my application. Here's my current installer script, partially sourced from this answer. It worked fine before October 8, 2019:

function Controller() {
    installer.autoRejectMessageBoxes();
    installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Ignore);
    installer.setMessageBoxAutomaticAnswer("installationError", QMessageBox.Ignore);
    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, 10000);
}

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

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

Controller.prototype.DynamicTelemetryPluginFormCallback = function() {
    var widget = gui.currentPageWidget();
    widget.TelemetryPluginForm.statisticGroupBox.disableStatisticRadioButton.checked = true;
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.TargetDirectoryPageCallback = function() {
    gui.currentPageWidget().TargetDirectoryLineEdit.setText("C:\\Qt");
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.ComponentSelectionPageCallback = function() {
    var widget = gui.currentPageWidget();

    console.log(JSON.stringify(widget));

    widget.ComponentsTreeView.

    widget.deselectAll();
    widget.selectComponent("qt.qt5.5131.win64_mingw73");
    widget.selectComponent("qt.tools.win64_mingw730");

    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);
}

I'm running the script with <path to installer>.exe --script <path to installer script>.qs --verbose

Running the online installer with this install script doesn't cause any errors, but it just doesn't install qt.qt5.5131.win64_mingw73.

Joshua Wade
  • 4,755
  • 2
  • 24
  • 44
  • Can't you directly download from https://download.qt.io/ ? – Xatyrian Oct 09 '19 at 19:35
  • I could be missing something, but I think that's still an installer (https://download.qt.io/official_releases/qt/5.13/5.13.1/), which I would still need to automate. I'm using the online installer because my CI/CD server (Github Actions in this case) has been hanging on very large downloads, including that installer. For that reason, I haven't actually checked the offline installer to see if it behaves differently, and in hindsight it likely does. – Joshua Wade Oct 09 '19 at 20:15
  • Even if Github Actions wasn't [currently breaking](https://github.com/SecondFlight/daw-prototype/commit/5ce6b0a0d86b8c4eecbb3b77061ff49f0f339f00/checks?check_suite_id=257089492), I'd still want to avoid downloading the full 5.13.1 installer, since I don't need most of what is downloaded. – Joshua Wade Oct 09 '19 at 20:51
  • [This looks like a ready-to-use version](https://download.qt.io/official_releases/qt/5.13/5.13.1/single/qt-everywhere-src-5.13.1.zip) – Xatyrian Oct 10 '19 at 08:25
  • And submodules are available in tthe submodules/ subdirectory – Xatyrian Oct 10 '19 at 08:26
  • That version is not ready-to-use by any stretch; it's the full Qt source code in a zip file. Not useless, but I'd like to avoid building *the entirety of Qt* from source when all I need is a few DLLs and binaries. Building the Qt source isn't trivial either. It [requires a fair amount of setup](https://doc.qt.io/qt-5/windows-requirements.html), though I may need to go that route if nothing else works. – Joshua Wade Oct 10 '19 at 13:15

1 Answers1

4

I found an example on Github that takes care of my issue. My ComponentSelectionPageCallback now looks like this:

Controller.prototype.ComponentSelectionPageCallback = function() {
    var page = gui.pageWidgetByObjectName("ComponentSelectionPage");

    var checkBox = gui.findChild(page, "Latest releases");
    var fetchButton = gui.findChild(page, "FetchCategoryButton");

    checkBox.click();
    fetchButton.click();

    var widget = gui.currentPageWidget();

    widget.deselectAll();
    widget.selectComponent("qt.qt5.5131.win64_mingw73");
    widget.selectComponent("qt.tools.win64_mingw730");

    gui.clickButton(buttons.NextButton);
}

See this file on Github for a complete example.

Joshua Wade
  • 4,755
  • 2
  • 24
  • 44