Created
October 11, 2017 11:33
-
-
Save pagdot/0719bf7fc62a6b9868c3dda2ecb38d2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
QT_DIR=$1 | |
test -e $QT_DIR || mkdir -p $QT_DIR | |
cat << EOF > $QT_DIR/5.9.2-installer.qs | |
// Bases on script from http://stackoverflow.com/a/34032216 | |
function Controller() { | |
installer.autoRejectMessageBoxes(); | |
installer.installationFinished.connect(function() { | |
gui.clickButton(buttons.NextButton); | |
}) | |
} | |
Controller.prototype.WelcomePageCallback = function() { | |
gui.clickButton(buttons.NextButton); | |
} | |
Controller.prototype.CredentialsPageCallback = function() { | |
gui.clickButton(buttons.NextButton); | |
} | |
Controller.prototype.IntroductionPageCallback = function() { | |
gui.clickButton(buttons.NextButton); | |
} | |
Controller.prototype.TargetDirectoryPageCallback = function() | |
{ | |
gui.currentPageWidget().TargetDirectoryLineEdit.setText("$QT_DIR/5.9.2"); | |
gui.clickButton(buttons.NextButton); | |
} | |
Controller.prototype.ComponentSelectionPageCallback = function() { | |
var widget = gui.currentPageWidget(); | |
// You can get these component names by running the installer with the | |
// --verbose flag. It will then print out a resource tree. | |
widget.deselectAll(); | |
widget.selectComponent("qt.59.android_armv7"); | |
// 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); | |
} | |
EOF | |
if [ ! -e $QT_DIR/5.9.2 ]; then | |
wget https://download.qt.io/official_releases/qt/5.9/5.9.2/qt-opensource-linux-x64-5.9.2.run | |
echo "Installing Qt SDK 5.9.2 to $QT_DIR/5.9.2 ..." | |
./qt-opensource-linux-x64-5.9.2.run --platform minimal --script $QT_DIR/5.9.2-installer.qs --verbose | |
echo "Qt SDK 5.9.2 installation done." | |
fi | |
rm $QT_DIR/5.9.2-installer.qs | |
rm qt-opensource-linux-x64-5.9.2.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment