我想知道是否有办法在Ubuntu Server上静默安装Qt运行安装程序?
我的意思是绕过安装程序的选项并进行默认安装?
我的意思是绕过安装程序的选项并进行默认安装?
Qt工具包使用Qt安装程序框架(QtIFW)打包。 QtIFW安装程序支持–script选项,允许您通过
Controller Scripting API以编程方式控制安装。这是qt-installer-noninteractive.qs文件以非交互方式安装Qt 5:
原文链接:https://www.f2er.com/ubuntu/349218.html// Emacs mode hint: -*- mode: JavaScript -*- 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(installer.value("HomeDir") + "/Qt"); gui.clickButton(buttons.NextButton); } Controller.prototype.ComponentSelectionPageCallback = function() { var widget = gui.currentPageWidget(); widget.deselectAll(); widget.selectComponent("qt.55.gcc_64"); widget.selectComponent("qt.55.qtquickcontrols"); // widget.deselectComponent("qt.tools.qtcreator"); // widget.deselectComponent("qt.55.qt3d"); // widget.deselectComponent("qt.55.qtcanvas3d"); // widget.deselectComponent("qt.55.qtlocation"); // widget.deselectComponent("qt.55.qtquick1"); // widget.deselectComponent("qt.55.qtscript"); // widget.deselectComponent("qt.55.qtwebengine"); // widget.deselectComponent("qt.extras"); // widget.deselectComponent("qt.tools.doc"); // widget.deselectComponent("qt.tools.examples"); 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); }
此脚本演示了如何选择/取消选择某些组件。根据您的需求进行自定义,或者仅为默认安装完全删除行。同样,您可能希望自定义或删除TargetDirectoryLineEdit行。运行Qt安装程序,如:
qt-opensource-linux-x64-5.5.1.run --script qt-installer-noninteractive.qs