Skip to content

Instantly share code, notes, and snippets.

@WindAzure
Created June 4, 2019 15:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WindAzure/f3bed9e058cdc81eaa357414610c9125 to your computer and use it in GitHub Desktop.
Save WindAzure/f3bed9e058cdc81eaa357414610c9125 to your computer and use it in GitHub Desktop.
Silent Install script for Qt installer.
function Controller() {
gui.setSilent(true);
installer.autoRejectMessageBoxes();
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Ignore);
installer.installationFinished.connect(function() {
console.log("install finished");
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
console.log("Welcome");
gui.clickButton(buttons.NextButton, 3000);
}
Controller.prototype.CredentialsPageCallback = function() {
console.log("CredentialsPageCallback");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
console.log("IntroductionPageCallback");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
console.log("TargetDirectoryPageCallback");
var widget = gui.currentPageWidget();
gui.currentPageWidget().TargetDirectoryLineEdit.setText("C:\\Qt");
gui.clickButton(buttons.NextButton, 3000);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.deselectAll();
widget.selectComponent("qt.qt5.5111.win32_msvc2015");
widget.selectComponent("qt.qt5.5111.win64_msvc2017_64");
widget.selectComponent("t.qt5.5111.qtcharts");
widget.selectComponent("qt.qt5.5111.qtwebengine");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
console.log("LicenseAgreementPageCallback");
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
console.log("StartMenuDirectoryPageCallback");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
console.log("ReadyForInstallationPageCallback");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
console.log("FinishedPageCallback");
var lanchQtCreatorCheckBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
if(lanchQtCreatorCheckBoxForm)
{
lanchQtCreatorCheckBoxForm.launchQtCreatorCheckBox.setChecked(false);
}
gui.clickButton(buttons.FinishButton);
console.log("Press any key to continue");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment