Q:

Qt Installer Framework: conditional action based on whether a component was selected for installation

Generally: I need a bool or other hook to determine whether a component has been selected for installation, so that my controlscript.qs (or component-specific installscript.qs) can take the appropriate action.
Specifcally: the Qt installer framework has several default pages for the user to click through. On Windows there is a StartMenuSelection page which allows the user to specify what group (if any) the shortcut to the application should go into in the Windows Start menu.
Start Menu group selection example
One of my components to be installed is an (optional) shortcut in the Start menu. If not selected for install, there will be no shortcut to the installed application in the start menu.
My issue is that the Start Menu group selection page shows up regardless of whether the user has asked for a shortcut in the Start menu. I know how to get rid of it in all cases. But not conditionally on whether a Start menu shortcut is actually being installed.
I have a control script with the following:
function Controller()
{
}

Controller.prototype.StartMenuDirectoryPageCallback = function()
{
  // Get the current wizard page
  var widget = gui.currentPageWidget(); 
  if (widget != null) {
    var component = installer.componentByName("startmenu"); // startmenu is the component name
    //if (!component.isSelected){
    //if (!component.isSelectedForInstallation){
    if (!component.isInstalled){
      // I only want this hidden if the user didn't want a start menu link
      // Either of the below commands will skip the startMenuSelection page
      installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
      //gui.clickButton(buttons.NextButton);
    }
  }
}

But this doesn't work. component.isSelected and component.isSelectedForInstallation always return false, and component.isInstalled always returns true, regardless of if the component was actually selected for installation. Maybe these are the wrong booleans to ask? 
Or maybe this is the wrong approach? Essentially, I just need a hook to determine if a component is selected or not.

A:

Just found this link:
https://github.com/danimo/qt-creator/blob/master/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs
Here they use:
component.installed
The isInstalled is a function (http://doc.qt.io/qtinstallerframework/scripting-component.html#isInstalled-method) that's why probably it always returns true.
So probably component.isInstalled() would have worked as well...
Either, installationRequested() would be another possibility to use. This is probably set before actual installation.

