Создание неинтерактивного деинсталлятора Qt - PullRequest
0 голосов
/ 07 июня 2019

В настоящее время у меня есть неинтерактивный скрипт, который я использую при установке Qt 5.8, который я называю следующим образом:

$ sudo ./qt-opensource-linux-x64-5.8.0.run --script qt-noninteractive.qs

Содержимое сценария установки выглядит следующим образом:

QT-noninteractive.qs

function Controller() {
    installer.autoRejectMessageBoxes();
    installer.installationFinished.connect(function() {
        gui.clickButton(buttons.NextButton);
    })
}

Controller.prototype.WelcomePageCallback = function() {
    gui.clickButton(buttons.NextButton, 3000);
}

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

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

Controller.prototype.TargetDirectoryPageCallback = function()
{
    gui.currentPageWidget().TargetDirectoryLineEdit.setText("/opt/Qt5.8.0");
    gui.clickButton(buttons.NextButton);
}

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

    widget.selectAll();
    widget.deselectComponent('qt.580.src');
    widget.deselectComponent("qt.tools.qtcreator");

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

Этот скрипт успешно выполняется, и установка завершается без проблем.

Как мне запустить и создать соответствующий скрипт удаления?

Будет ли вызов выглядеть примерно так:

sudo ./MaintenanceTool --script qt-noninteractive-uninstall.qs
...