forked from jamulussoftware/jamulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqt-installer-windows.qs
126 lines (102 loc) · 4.29 KB
/
qt-installer-windows.qs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
* Qt Installer script for a non-interactive installation of Qt5 on Windows.
*
* Run with:
* qt-unified-windows-x86-online.exe --verbose --script qt-installer-windows.qs
*
* globals QInstaller, QMessageBox, buttons, gui, installer, console
*/
function Controller() {
installer.setMessageBoxAutomaticAnswer("installationError", QMessageBox.Retry);
installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Retry);
installer.setMessageBoxAutomaticAnswer("DownloadError", QMessageBox.Retry);
installer.setMessageBoxAutomaticAnswer("archiveDownloadError", QMessageBox.Retry);
// Continue on installation to an existing (possibly empty) directory.
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
// Continue at the end of the installation
installer.installationFinished.connect(function() {
console.log("Step: 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());
var page = gui.pageWidgetByObjectName("CredentialsPage");
var username = installer.environmentVariable("QT_ACCOUNT_USERNAME");
var password = installer.environmentVariable("QT_ACCOUNT_PASSWORD");
page.loginWidget.EmailLineEdit.setText(username);
page.loginWidget.PasswordLineEdit.setText(password);
gui.clickButton(buttons.NextButton);
};
Controller.prototype.IntroductionPageCallback = function()
{
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.ObligationsPageCallback = function()
{
console.log("Step: " + gui.currentPageWidget());
var page = gui.pageWidgetByObjectName("ObligationsPage");
page.obligationsAgreement.setChecked(true);
page.completeChanged();
gui.clickButton(buttons.NextButton);
}
Controller.prototype.DynamicTelemetryPluginFormCallback = function()
{
console.log("Step: " + gui.currentPageWidget());
var page = gui.pageWidgetByObjectName("DynamicTelemetryPluginForm");
page.statisticGroupBox.disableStatisticRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.ComponentSelectionPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
var selection = gui.pageWidgetByObjectName("ComponentSelectionPage");
gui.findChild(selection, "Latest releases").checked = false;
gui.findChild(selection, "LTS").checked = true;
gui.findChild(selection, "FetchCategoryButton").click();
// Look for Name elements in
// https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml
var widget = gui.currentPageWidget();
widget.deselectAll();
widget.selectComponent("qt.qt5.5123.win32_msvc2017");
widget.selectComponent("qt.qt5.5123.win64_msvc2017_64");
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());
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
};