Comments

1 comment

  • Avatar
    Jake

    You can easily configure entries in the Start Menu for your application using the Builder graphical interface. You just need to load your project XML file and go to "Files" -> "Start Menu (Windows)". There you may add new shortcuts and folders using the icons on the right panel.

    In case you want to add Start Menu shortcuts by editing directly the XML file, you just need to add a <startMenuShortcutList> inside a <component> element, for instance:

    <startMenuShortcutList>
      <startMenuShortcut>
        <comment>Start${product_fullname} service</comment>
        <name>Start ${product_fullname} service</name>
        <windowsExec>${installdir}\ctl.bat</windowsExec>
        <windowsExecArgs>start</windowsExecArgs>
        <windowsIcon>${installdir}\youricon.ico</windowsIcon>
        <windowsPath>${installdir}</windowsPath>
      </startMenuShortcut>
      <startMenuShortcut>
        <comment>Stop ${product_fullname} service</comment>
        <name>Stop ${product_fullname} service</name>
        <windowsExec>${installdir}\ctl.bat</windowsExec>
        <windowsExecArgs>stop</windowsExecArgs>
        <windowsIcon>${installdir}\youricon.ico</windowsIcon>
        <windowsPath>${installdir}</windowsPath>
      </startMenuShortcut>
    </startMenuShortcutList>

    The code above will create a new entry in the Start Menu (which name will defaults to the <fullName> project property, although you can customize it through the <startMenuGroupName> property), and inside it it will create two shortcuts.

    You can also create folders using the <startMenuFolder> tag, which can contain additional <startMenuShortcutList> elements, to achieve more complex designs:

      <startMenuShortcutList>
        <!-- Here you may place any shortcuts that will be placed directly 
        under the main application folder in the Start Menu -->
        <startMenuFolder>
          <name>Some Name</name>
          <platforms>windows</platforms>
          <startMenuShortcutList>
            <!-- Here you may place any shortcuts to be placed inside the folder -->
          </startMenuShortcutList>
        </startMenuFolder>
      </startMenuShortcutList>
    

    The shortcuts will be by default installed for All Users, in case the user running the installer is an Administrator, or for the current user otherwise. To force the shortcuts to be installed for the current user only, no matter if it is an administrator or not, you may set the following property:

    <installationScope>user</installationScope>
    

    You can also create optional shortcuts depending on the user input:

    <parameterList>
        ...
        <booleanParameter>
            <displayStyle>checkbox-left</displayStyle>
            <name>createshortcut</name>
            <description>Would you like to create a start menu shortcut?</description>
            <value>1</value>
        </booleanParameter>
        ...
    </parameterList>
    
    <startMenuShortcutList>
        <startMenuShortcut>
            <comment>Optional uninstallation shortcut of ${product_fullname}</comment>
            <name>Uninstall ${product_fullname}</name>
            <runInTerminal>0</runInTerminal>
            <windowsExec>${installdir}/${uninstallerName}.exe</windowsExec>
            <windowsExecArgs></windowsExecArgs>
            <windowsIcon></windowsIcon>
            <windowsPath>${installdir}/</windowsPath>
            <ruleList>
                <isTrue value="${createShortcut}" />
            </ruleList>
        </startMenuShortcut>
    </startMenuShortcutList>
    

Please sign in to leave a comment.