I have created a simple installer for our product with only 1 component and no remote repositories manager.
When I start the uninstaller, the introduction page shows 3 radio buttons:
Package manager
Update components
Remove all components
I need only the third one, so I checked this documentation:
http://doc-snapshot.qt-project.org/qtifw-master/noninteractive.html
As I have understood and being unable to hide the buttons, I added this to my install.qs file:
function Controller()
{
}
Controller.prototype.IntroductionPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
This should auto-click Next on the introduction page so it should go directly to the uninstall page.
Nothing happens, what ever I write in the Controller functions, the introduction page shows the 3 radio buttons. I added some messagebox in the function and they are never called.
Somebody knows how to solve it ?
I think I have 2 working solutions.
You need to create a Controller like the one you started before:
function Controller() {
if (installer.isUninstaller()) {
installer.setDefaultPageVisible(QInstaller.Introduction, false);
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
}
}
This will disable all pages in the classic install/uninstall workflow. Make sure to check you're in uninstall mode.
function Controller()
{
}
Controller.prototype.IntroductionPageCallback = function()
{
if (installer.isUninstaller()) {
// Get the current wizard page
var widget = gui.currentPageWidget();
if (widget != null) {
// Don't show buttons because we just want to uninstall the software
widget.findChild("PackageManagerRadioButton").visible = false;
widget.findChild("UpdaterRadioButton").visible = false;
widget.findChild("UninstallerRadioButton").visible = false;
}
}
}
In installer mode, select by default "I accept" the Licence Agreement. Seriously, who doesn't?
Controller.prototype.LicenseAgreementPageCallback = function()
{
var widget = gui.currentPageWidget();
if (widget != null) {
widget.AcceptLicenseRadioButton.checked = true;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With