How can I add entries to the Start Menu on Windows

Author: BitRock Support       Date: August 04, 2008 10:51       Tags: Installbuilder
Shortcuts and start menu
Windows
Customization

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>

 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up