wireshark/tools/qt-installer-windows.qs
Peter Wu 5ed8360c21 travis: initial Windows support with non-interactive Qt installer
The current preview release of Windows support on Travis lacks many
packages (like Qt and Python 3) and is very much tied to git-bash
(unlike AppVeyor which has a more native Windows experience).

Several workarounds were necessary, such as reimplementing refreshenv,
setting CMAKE_PROGRAM_PATH) and setting a supported language. See also
https://travis-ci.community/t/feedback-from-windows-integration-for-a-cmake-qt-c-python-perl-project/1706

I wrote the Qt installer script originally for Qt 5.6, ported it to Qt
5.9.5 and finally updated it for 5.12, some comments could be outdated.

Duration as measured for one x64 build:
- 3m00s - restore cache (Qt and wireshark-libs)
- 2m22s - choco install
- 0m8s - pip install
- 2m20s - cmake
- 18m5s - build all
- 0m20s - build test-programs
- 5m34s - pytest -v
- 2m46s - store cache (Qt and wireshark-libs)
- (total duration about 36m)
- (installing Qt 5.12.0 from scratch would add 7m)

Cache size for extracted x64 build: wireshark-libs is 187M, Qt 604M.
(179M and 516M for 32-bit respectively.)

Change-Id: I9881ab6439e9ca99efad16a6c861862ab9d35252
Reviewed-on: https://code.wireshark.org/review/31454
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12 21:56:47 +00:00

93 lines
3.4 KiB
JavaScript

/*
* Qt Installer script for a non-interactive installation of Qt5 on Windows.
* Installs the 64-bit package if environment variable PLATFORM="x64".
*/
// jshint strict:false
/* globals QInstaller, QMessageBox, buttons, gui, installer, console */
// Run with:
// .\qt-unified-windows-x86-3.0.4-online.exe --verbose --script tools\qt-installer-windows.qs
// Look for Name elements in
// https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5120/Updates.xml
// Unfortunately it is not possible to disable deps like qt.tools.qtcreator
var INSTALL_COMPONENTS = [
installer.environmentVariable("PLATFORM") == "x64" ?
"qt.qt5.5120.win64_msvc2017_64" :
"qt.qt5.5120.win32_msvc2017",
];
function Controller() {
// Continue on installing to an existing (possibly empty) directory.
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
// Continue at "SHOW FINISHED PAGE"
installer.installationFinished.connect(function() {
console.log("installationFinished");
gui.clickButton(buttons.NextButton);
});
}
Controller.prototype.WelcomePageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
// At least for 3.0.4 immediately clicking Next fails, so wait a bit.
// https://github.com/benlau/qtci/commit/85cb986b66af4807a928c70e13d82d00dc26ebf0
gui.clickButton(buttons.NextButton, 1000);
};
Controller.prototype.CredentialsPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.IntroductionPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.TargetDirectoryPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
// Keep default at "C:\Qt".
//gui.currentPageWidget().TargetDirectoryLineEdit.setText("E:\\Qt");
gui.clickButton(buttons.NextButton);
};
Controller.prototype.ComponentSelectionPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
var page = gui.currentPageWidget();
page.deselectAll();
for (var i = 0; i < INSTALL_COMPONENTS.length; i++) {
page.selectComponent(INSTALL_COMPONENTS[i]);
}
gui.clickButton(buttons.NextButton);
};
Controller.prototype.LicenseAgreementPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
};
Controller.prototype.StartMenuDirectoryPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.ReadyForInstallationPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.FinishedPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
// TODO somehow the installer crashes after this step.
// https://stackoverflow.com/questions/25105269/silent-install-qt-run-installer-on-ubuntu-server
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
};
// vim: set ft=javascript: