Paraglider BartPE Plugins

Items are missing from my nu2menu menu

Usually the reason for things not showing up in the menu is incorrect plugin XML files. The tags in the XML files are case sensitive so <MENU> is not the same as </menu>.  Every opening tag needs a closing tag:

  • <MITEM> and </MITEM>
  • <MENU> and </MENU>
  • <NU2MENU> and </NU2MENU>

All MENU, MITEM, NU2MENU nodes should be written in uppercase. The only exceptions to this are:

  • the MENUID attribute value
  • the DISABLED attribute value
  • the FUNC attribute value
  • <MITEM> descriptions

An attribute value is the string in double quotes i.e. FUNC="Attribute Value"

Every plugin file should start with <NU2MENU> and end with </NU2MENU>. The only plugin that starts with <?xml version="1.0"?> should be the nu2menu.xml file in the nu2menu plugin.

Another problem is using invalid characters in the menu entry description. Characters like &, <, > , should be replaced with their escaped version: &amp;, &lt;, &gt; respectively.

Thus you should replace:

<MITEM FUNC="...." CMD="RUN" TYPE="ITEM"> I am using & and < and > in this description</MITEM>

with

<MITEM FUNC="...." CMD="RUN" TYPE="ITEM">I am using &amp; and &lt; and &gt; in this description</MITEM>

Usually all these errors can be found by loading the built XML file into internet explorer. Before you do this you should make a temporary change so that the file only has one node. After the <?xml version="1.0" ?> and before the first <NU2MENU> add a dummy tag like <AAAA>. Add to the end of the file after the final </NU2MENU> a corresponding end tag </AAAA>.

The other problem is that the menu refers to other parent menus that don't exist earlier in the XML file. Thus define your plugin XML file like:

<NU2MENU> 

<MENU ID="Programs">
<MITEM TYPE="POPUP" MENUID="SystemTools">System Tools</MITEM>
</MENU>

<MENU ID="SystemTools">
<MITEM disabled FUNC CMD="RUN" TYPE="ITEM"="...">
                         Device Manager Clone</MITEM>
</MENU>

</NU2MENU>

so that in this example "System Tools" is located relative to a menu that is always there ( "Programs" ). The attribute ID value in a MENU item must match an earlier defined MENUID attribute value of TYPE="POPUP" in a MITEM node.

If you miss out:

<MENU ID="Programs">
<MITEM TYPE="POPUP" MENUID="SystemTools">System Tools</MITEM>
</MENU>

and some prior plugin does not define the "SystemsTools" menu then your menu item will disappear.

The approach I take is to define the menu structure for a plugin in every plugin i.e. the TYPE="POPUP" item in the above example. This means you are not dependant on plugin ordering. The disadvantage of this approach is that if multiple plugins define the same popup menu then you will get multiple entries for the same menu in your running menu. This can be avoided by using my sortmenu utility prior to building the iso file.

The other approach is to define your menu structure in the nu2menu plugin nu2menu.xml file - you only need to define the TYPE="POPUP" nodes not the menu items in this file. So in the above example you would remove the:

<MENU ID="Programs">
<MITEM TYPE="POPUP" MENUID="SystemTools">System Tools</MITEM>
</MENU>

from the plugin and add it to the nu2menu.xml file in the nu2menu plugin directory.

The menu structure can be checked by running my SortMenu tool from the command line against the built nu2menu.xml file in <OutDir>\Programs\nu2menu i.e

sortmenu <OutDir>\Programs\nu2menu

Replace <OutDir> with the path to the pebuilder output directory.