Disable 'Cancel' & 'Close' buttons in install.qs
Unsolved
Installation and Deployment
-
Hi. I have an extremely simple requirement.
I have a working script, which is copied from the sample 'install.qs', for a product called 'OpenStudio' which can be driven by QT script. I However, as the installation time is quite lengthy and our users, like most, are extremely impatient, I want to disable the 'Cancel' and 'Close' buttons, if that's possible.
Here's the script:
Controller.prototype.IntroductionPageCallback = function () { gui.clickButton(buttons.NextButton) } Controller.prototype.ComponentSelectionPageCallback = function () { var widget = gui.currentPageWidget(); if (widget != null) { // to install a subset of components, uncomment the code below and edit as neccesary //widget.deselectAll(); //widget.selectComponent('SketchUpPlugin'); //widget.selectComponent('CLI'); //widget.selectComponent('RubyAPI'); //widget.selectComponent('CSharpAPI'); //widget.selectComponent('PAT'); //widget.selectComponent('OpenStudioApp'); //widget.selectComponent('DView'); //widget.selectComponent('EnergyPlus'); //widget.selectComponent('Radiance'); //widget.selectComponent('Resources'); gui.clickButton(buttons.NextButton); } } Controller.prototype.TargetDirectoryPageCallback = function () { // set install directory if needed var widget = gui.currentPageWidget(); if (widget != null) { widget.TargetDirectoryLineEdit.setText("c:\\openstudio-2.9.1") gui.clickButton(buttons.NextButton); } } Controller.prototype.StartMenuDirectoryPageCallback = function () { gui.clickButton(buttons.NextButton); } Controller.prototype.ReadyForInstallationPageCallback = function () { gui.clickButton(buttons.NextButton); } Controller.prototype.FinishedPageCallback = function () { gui.clickButton(buttons.FinishButton); }
-
Just tried this:
Controller.prototype.ReadyForInstallationPageCallback = function () { var page = gui.pageWidgetByObjectName("ReadyForInstallationPage"); var cancelButton = gui.findChild(page, "CancelButton"); if (cancelButton != null) { console.log("cancelButton found"); cancelButton.setEnabled(false); cancelButton.enabled = false; } else { console.log("cancelButton NOT found"); } // gui.clickButton(buttons.NextButton); }
Again, the 'Cancel' button is still present/enabled.