Help - Search - Members - Calendar
Full Version: Beginner XML editing issue...
UBCD4Win Forums > Other Support > Bart's PE support
BvF7734
I figured it was about time for me to move my 5 additional plugins to a folder off of the applications menu. I finally grew tired of seeing them stand out instead of properly nested down. Instead of putting them in existing menu items, I wanted to create my own menu folder entry wamy jammy called My Tools. So I cracked out notepad and opened my XML files and opened random ones from other folders to get a "feel" for how it is laid out and deduce on my own how to place them where and how. I did this and all seemed to jive with everything I have seen with other plugins. Commenced the build and only mod from default and adding in my 5 plugins was to disable all multiboot options and disable all AV and anti-spyware stuff to save space in preperation of making a USB version. Build completed no errors and though hot damn it worked!! Fired up Virtual box and my heart sank... Noobish XML screwups have caused 3 games entries, multitude of other folders corresponding to the number of apps in the folders. What did I do wrong? I have included them for your peer perusal.

Easy Recovery 6 Pro
CODE
<!-- Nu2Menu entry for Easy Recovery Pro 6 -->
<NU2MENU>
    <MENU ID="Programs">               
        <MITEM TYPE="POPUP" MENUID="My Tools">My Tools</MITEM>
    </MENU>
  <menu ID="My Tools">
                <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\Ontrack\EasyRecovery Professional\EasyRecovery.exe))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\Ontrack\EasyRecovery Professional\EasyRecovery.exe">EasyRecovery Professional</MITEM>
    </MENU>
</NU2MENU>

EPHD Encryption
CODE
<!-- Nu2Menu entry for EPHD ACCESS UTILITY-->
<NU2MENU>
    <MENU ID="Programs">               
        <MITEM TYPE="POPUP" MENUID="My Tools">My Tools</MITEM>
    </MENU>
  <menu ID="My Tools">
        <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetWinDir()\system32\EPHD_ACCESS_UTILITY.EXE))" CMD="RUN" FUNC="@GetWinDir()\system32\EPHD_ACCESS_UTILITY.EXE">EPHD ACCESS UTILITY</MITEM>
    </MENU>
</NU2MENU>

Where I want ghost...
CODE
<!-- Nu2Menu entry for Symantec Ghost32 -->
<NU2MENU>
    <MENU ID="Programs">               
        <MITEM TYPE="POPUP" MENUID="My Tools">My Tools</MITEM>
    </MENU>
  <menu ID="My Tools">
        <MITEM TYPE="POPUP" MENUID="Ghost">Ghost</MITEM>
    </MENU>

    <MENU ID="Ghost">
        <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\ghost8\ghost32.exe))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\ghost8\ghost32.exe">Ghost32</MITEM>
        <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\ghost8\ghostsrv.exe))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\ghost8\ghostsrv.exe">GhostCast Server</MITEM>
        <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\ghost8\ghostexp.exe))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\ghost8\ghostexp.exe">Ghost Explorer</MITEM>
    </MENU>
</NU2MENU>

Total Commander
CODE
<!-- Nu2Menu entry for Total Commander -->
<NU2MENU>
    <MENU ID="Programs">               
        <MITEM TYPE="POPUP" MENUID="My Tools">My Tools</MITEM>
    </MENU>
  <menu ID="My Tools">
        <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\totalcmd\totalcmd.exe))" CMD="RUN"
            FUNC="@GetProgramDrive()\Programs\totalcmd\totalcmd.exe /i=@GetProgramDrive()\Programs\totalcmd\wincmd.ini /f=@GetProgramDrive()\Programs\totalcmd\wcx_ftp.ini /l=@GetProgramDrive()\Programs /r=@GetProgramDrive()\Programs=">Total Commander</MITEM>
    </MENU>
</NU2MENU>

WinRAR
CODE
<!-- Nu2Menu entry for winRAR -->
<NU2MENU>
    <MENU ID="Programs">               
        <MITEM TYPE="POPUP" MENUID="My Tools">My Tools</MITEM>
    </MENU>
  <menu ID="My Tools">
        <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\winRAR\WinRAR.exe))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\winRAR\WinRAR.exe">WinRAR 3.51</MITEM>
    </MENU>
</NU2MENU>


Did i screw something up? My uneducated to XML eye says that all tags are closed and that they are all properly laid out... I have to be missing something here...

Greatly appreciate your assistance in unscrewing my screwup.
rdsok
I'm not sure if the tags are case sensitive... I know I'm not seeing a type ( that doesn't mean ones not there )...

Try changing

menu ID to MENU ID
BvF7734
K Thanx for the response so far! Will try that here in a sec and report back.

Odd... I uncheck read only and i can not adjust the case of menu to MENU... very odd... Still checking though... Maybe me over look something! rolleyes.gif

It is not me... The menu will not go to MENU. maybe a function of XML? Benq was still typing at time of post so saving and will see what he says.
bengt
I do not really know if it is needed but whenever I add a new program under a new subtitel I usually also add an entry in the nu2menu.xml just to be on the safe side.

CODE

<MENU ID="Programs">
<MITEM TYPE="POPUP" MENUID="Accessories">Accessories</MITEM>
<MITEM TYPE="POPUP" MENUID="Anti-Spyware Tools">Anti-Spyware Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="Anti-Virus Tools">Anti-Virus Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="Applications">Applications</MITEM>
<MITEM TYPE="POPUP" MENUID="Articles">Articles</MITEM>
<MITEM TYPE="POPUP" MENUID="Bio-Informatics">Bio-Informatics</MITEM>
<MITEM TYPE="POPUP" MENUID="CD Burning Tools">CD Burning Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="Disk Tools">Disk Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="File Management">File Management</MITEM>
<MITEM TYPE="POPUP" MENUID="Games">Games</MITEM>
<MITEM TYPE="POPUP" MENUID="Internet">Internet</MITEM>
<MITEM TYPE="POPUP" MENUID="Lectures">Lectures</MITEM>
<MITEM TYPE="POPUP" MENUID="Network Tools">Networking Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="Registry Tools">Registry Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="Research">Research</MITEM>
<MITEM TYPE="POPUP" MENUID="Password Tools">Password Tools</MITEM>
<MITEM TYPE="POPUP" MENUID="Roller-Dex">Roller-Dex</MITEM>
<MITEM TYPE="POPUP" MENUID="Staff">Staff</MITEM>
<MITEM TYPE="POPUP" MENUID="Statistics">Statistics</MITEM>
<MITEM TYPE="POPUP" MENUID="System Information">System Information</MITEM>
<MITEM TYPE="POPUP" MENUID="Shell Features">Shell Features</MITEM>
</MENU>


and as rdsok pointed out:

QUOTE
Menu file rules

If you create your own menu file you must obey the following rules:
- all menu nodes must be written in uppercase,
- function names for the scripting language are case sensitive

http://www.nu2.nu/nu2menu/
mbarnes
Hi BvF7734

a easy way to check syntax of xxx_nu2menu.xml file is to open xml file in IE and or Firefox,
there should be no error messages and you should be able to browse to end of file.

with one of you examples I got an error indicating

<menu does not equal <MENU (all upper or all lowercase required)

You can't do this on bartpe\nu2menu\nu2menu.xml unless you edit it so line 2 is <test> and last line is </test>
(test or any other word will do)
then remove these lines again after testing.
Even if syntax is correct not all problems are found and programs may not appear on menu.

Paraglider has a utility sortmenu.exe which can be used to check syntax and remove duplicate entries in nu2menu.xml which is included with ubcd4win project
Its error messages were not always detected by build process. (not sure if that was fixed)

regards
Mike Barnes
Zharif
Yes, tags are case sensitive (as nearly everything in nu2menu syntax).

Just did a short test (with EasyRecovery Pro xml):
With your posted syntax I see entry "My Tools" but also entry "EasyRecovery Professional" in ONE box.

Change ">menu ID>" to "<MENU ID>" (as rdsok suggested).
This solved the problem for me

@bengt,
You only have to specify a directory menu entry in "\\plugin\nu2menu\nu2menu.xml" if it should appear in the startmenu directly.
Then you've to add a line under "<MENU ID="Startmenu">" section.
Entry "Programs" is already created in "Startmenu" section of original nu2menu.xml.
As long as your subdirectory path in your plugin xml points to "programs" it can be done in the way as BvF7734 did.
bengt
@Zharif
Thanks, smile.gifyes yes.gifI know that, just wanted to quickly point out the entries in the \oem1\nu2menu\nu2menu.xml.

I have several sub- and sub-sub entries in my nu2menu.xml and to top it off I have the same setup in each of the plugins .xml,
but that is how I do it. Double safety. But when on the odd occasion, when it goes wrong, it can mess things up real good (bad).
BvF7734
Thanx again for all the replies! I was using UltraEdit to look at the XML and I have a feeling that that was what was causing my inability to edit the file to correct case. I opened in notepad and changed it and received no error opening in FF. I have to be leaving work shortly so will continue this tomorrow. I will edit all my xml in Noepad and try to build again.

So to recap, do I or do I not have to edit the nu2menu.xml to add my My Tools directory? I know it was thrown in as a suggestion but now am slightly off kilter here...
bengt
@BvF7734
You will do fine with your current setup yes.gif

Notepad++ is an excellent text editor.
LittlBUGer
QUOTE(bengt @ Mar 8 2007, 02:47 PM) *
@BvF7734
You will do fine with your current setup yes.gif

Notepad++ is an excellent text editor.


Or TextPad. smile.gif
bengt
Notepad++ is Free yes.gif

TextPad
QUOTE
...costs only £16.50 GBP (approximately $32 USD).

http://www.textpad.com/download/https://www.ubcd4win.com/l
LittlBUGer
QUOTE(bengt @ Mar 8 2007, 03:49 PM) *
Notepad++ is Free yes.gif

TextPad
QUOTE
...costs only £16.50 GBP (approximately $32 USD).

http://www.textpad.com/download/https://www.ubcd4win.com/l


Uhhh, TextPad is free to use forever too... you don't HAVE to pay for it. You'll just get one nag screen each time you run it though. smile.gif

And, interestingly enough, 5.0 FINALLY came out just recently. smile.gifI've just always preferred TextPad as I've used it for far longer than NotePad++ and I can easily find my VB.NET and ASP.NET plugins for it. smile.gif
BvF7734
I would like to take the time to thank everyone who offered advice. I found Notepad++Portable on portable apps.com and added them to my portable suite. This app then allowed me to make the mods to my xml files. I rebuilt and they work perfectly now. I love UltraEdit as it allows you to view and edit any file period but it is dumb when handling XML apparently. That was what was wanting to reduce the case of the menu item.

Thanx again!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.