Author Topic: Multi Commander Custom Menu (issues!)  (Read 19980 times)

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Multi Commander Custom Menu (issues!)
« on: June 29, 2018, 20:18:51 »
@Mathias (Author)
@All of You

I would like to ask you for help.
I am creating custom menu for Multi Commander (using NSIS) for my UFM project.
I create UserMenu.xml file and UserDefinedCommands.xml.

Here is my UserMenu.xml file: http://www.meggamusic.co.uk/shup/1530295428/UserMenu.xml
Here is my UserDefinedCommands.xml file: http://www.meggamusic.co.uk/shup/1530295450/UserDefinedCommands.xml

PROBLEM:
Multi Commander do not display some of menu entries (the last ones => Programy -> Narzędzia -> Universal Extractor 2 -> Submenus and all next).
Have no idea why... Bad GUID's? To many entries? Bad file encoding?
Could you please take a look?



How I make GUID:
Code: [Select]
###############################################################
# MC: GUID
###############################################################
!define UFM_CREATE_GUID "!insertmacro UFM_CREATE_GUID"
!macro UFM_CREATE_GUID "RESULT"

;GUID -> {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
System::Call 'ole32::CoCreateGuid(g .s)'
Pop "$0"
${WordReplace} "$0" "{" "" "+" "$0"
${WordReplace} "$0" "-" "" "+" "$0"
${WordReplace} "$0" "}" "" "+" "$0"
${StrFilter} "$0" "-" "" "" "$0"
Push "$0"
Pop ${RESULT}

!macroend

Multi Commander Custom Menu Editor shows this "empty" entries correctly.

Problem on short video (27Mb): https://www.dropbox.com/s/feqkf4wj1er74tt/MC_MENU.mp4?dl=0


Thanks for any help,
-Pawel

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: Multi Commander Custom Menu (issues!)
« Reply #1 on: June 29, 2018, 21:21:10 »
I will take a look on Sunday if you have not solved it by then.

So this is only guesses

MC assume the xml files are UTF8. So not sure if that can be the case, maybe that you have some national characters that breaks it ? (But Then it would not show anything at all I think., the entire load of the file would break)
You can try to resave the file as UTF8 and add the UTF8 xml header to the file
<?xml version="1.0" encoding="UTF-8"?>
But I do not think that will help


Also you create the GUID at install time? You can create a guid once and then use the same guid on all..
Also make sure the ID of the command and the user menu entire matched.. So you can use hardcoded id. just make sure it is a valid GUID then it would not collide if the user creates its own command. They are Global Unique. not just machine unique

Too many items ? Might be too many. Not sure what the limit is. But I think it is several 1000.. so should not be that.
But you can try to remove some of the entires in the beginning and see if the rest works. Then it might be that you hit a limit.  That we might be able to fix.

Hmm The file you linked are they how the files looked when installed or before NSIS process them ?
Because the NAME part look like Text tags.  Can you attach a version of the files as they look installed. Then I can debug with a real file and see why (if it is because of encoding or language issue)


Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Multi Commander Custom Menu (issues!)
« Reply #2 on: June 29, 2018, 22:01:23 »
I will take a look on Sunday if you have not solved it by then.

So this is only guesses

MC assume the xml files are UTF8. So not sure if that can be the case, maybe that you have some national characters that breaks it ? (But Then it would not show anything at all I think., the entire load of the file would break)
You can try to resave the file as UTF8 and add the UTF8 xml header to the file
<?xml version="1.0" encoding="UTF-8"?>
But I do not think that will help
XML declaration is OK. I tested it with UTF-8 (no BOM) or UCS-2 LE -> No difference. So, it seems encoding is not a problem in this case.

Also you create the GUID at install time? You can create a guid once and then use the same guid on all..
Also make sure the ID of the command and the user menu entire matched.. So you can use hardcoded id. just make sure it is a valid GUID then it would not collide if the user creates its own command. They are Global Unique. not just machine unique

Yes, I generate it on installer runtime. GUID's are different on different installation. I think I will change it to use hardcoed GUID's

Too many items ? Might be too many. Not sure what the limit is. But I think it is several 1000.. so should not be that.
But you can try to remove some of the entires in the beginning and see if the rest works. Then it might be that you hit a limit.  That we might be able to fix.
Yes. I removed some of entries before and it still not working...

Hmm The file you linked are they how the files looked when installed or before NSIS process them ?
Because the NAME part look like Text tags.  Can you attach a version of the files as they look installed. Then I can debug with a real file and see why (if it is because of encoding or language issue)

The files I linked are files generated by my installer - so they are installed.
I don't understand the part "becasue the NAME part look like Text tags" -> my generated menu is the same like I create it via MC built-in custom menu creator.
So, please, make a copy of your files, copy my files into your installation and check it with debugger and do some magic tricks to found out what is going on.

Thanks!

« Last Edit: June 29, 2018, 22:04:06 by Pawel »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: Multi Commander Custom Menu (issues!)
« Reply #3 on: June 30, 2018, 00:07:40 »
The files I linked are files generated by my installer - so they are installed.
I don't understand the part "becasue the NAME part look like Text tags" -> my generated menu is the same like I create it via MC built-in custom menu creator.
So, please, make a copy of your files, copy my files into your installation and check it with debugger and do some magic tricks to found out what is going on.

I mean that they look like this

Code: [Select]
<menuitem name="UFM_MENU_INFO_VERACRYPT" id="f30212ec6fdc46159fa733225f92921a"/>
<menuitem seperator="1"/>
<menuitem name="UFM_MENU_RUN_VERACRYPT" id="881708d4a47a49c58cf7e2a03bc79153"/>
<menuitem name="UFM_MENU_ADMIN_VERACRYPT" id="fe707e13d81d4f4d990cefd422d5b7f9"/>
<menuitem seperator="1"/>
<menuitem name="UFM_MENU_OPEN_EW_VERACRYPT" id="0479f00480a647349e1aa8ec84466c11"/>
<menuitem name="UFM_MENU_OPEN_MC_VERACRYPT" id="7cf4563f06c2440f8be9764647cbf95b"/>

The names looks like Name Tags, it will show up in the menu as that

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Multi Commander Custom Menu (issues!)
« Reply #4 on: June 30, 2018, 11:05:23 »
I made thousands of test this night... I have no idea what is the reason :(
When I remove some entries (before that not working - entries that are displayed correctly) from UserDefinedCommands.xml file it works!
Like xml parser can not support so many entries?

Ps: About Name Tags -> I use it only in definition of menu, in submentu I use text - so MC shows text (I tested it with text both in menu and submenu and no difference).
For example:
Now, I use it like this (it works fine):

; UserMenu.xml
  <menuitem displayname="&amp;Ultimate File Manager">
    <menuitem name="UFM_PROJECT_HELP" id="ccd7658789ac41038d581ce15263f29d"/>
    <menuitem name="UFM_PROJECT_HISTORY" id="5e4d79fe877d4ae68a8fad1c6cc40747"/>
  </menuitem>

; UserDefinedCommands.xml
  <userdefinedcommand name="UFM Help" id="ccd7658789ac41038d581ce15263f29d" type="multiscript">
    <tip>Open UFM Help File</tip>
    <command>@var $Win_Dir = TranslateEnvString("%WINDIR%");</command>
    <command>MC.Run CMD="{$Win_Dir}\hh.exe" ARG="${mcinstallpath}\..\HELP\UFM_ENG.chm"</command>
  </userdefinedcommand>
  <userdefinedcommand name="UFM changelog" id="5e4d79fe877d4ae68a8fad1c6cc40747" type="multiscript">
    <tip>Check UFM project changelog</tip>
    <command>@var $Win_Dir = TranslateEnvString("%WINDIR%");</command>
    <command>MC.Run CMD="{$Win_Dir}\hh.exe" ARG="ms-its:${mcinstallpath}\..\HELP\UFM_ENG.CHM::/Version/Version.html"</command>
  </userdefinedcommand>


Changing it to your suggestion change nothing:

; UserMenu.xml
  <menuitem displayname="&amp;Ultimate File Manager">
    <menuitem name="UFM Help" id="ccd7658789ac41038d581ce15263f29d"/>
    <menuitem name="UFM changelog" id="5e4d79fe877d4ae68a8fad1c6cc40747"/>
  </menuitem>

; UserDefinedCommands.xml
  <userdefinedcommand name="UFM Help" id="ccd7658789ac41038d581ce15263f29d" type="multiscript">
    <tip>Open UFM Help File</tip>
    <command>@var $Win_Dir = TranslateEnvString("%WINDIR%");</command>
    <command>MC.Run CMD="{$Win_Dir}\hh.exe" ARG="${mcinstallpath}\..\HELP\UFM_ENG.chm"</command>
  </userdefinedcommand>
  <userdefinedcommand name="UFM changelog" id="5e4d79fe877d4ae68a8fad1c6cc40747" type="multiscript">
    <tip>Check UFM project changelog</tip>
    <command>@var $Win_Dir = TranslateEnvString("%WINDIR%");</command>
    <command>MC.Run CMD="{$Win_Dir}\hh.exe" ARG="ms-its:${mcinstallpath}\..\HELP\UFM_ENG.CHM::/Version/Version.html"</command>
  </userdefinedcommand>


I suppose the problem is in MC and xml parsing (or I just don't get it :))
-Pawel

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: Multi Commander Custom Menu (issues!)
« Reply #5 on: July 02, 2018, 22:33:43 »
It is because there are too many commands.  I will see if I can increase the limit and add logging about it if the limit is reached

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Multi Commander Custom Menu (issues!)
« Reply #6 on: July 03, 2018, 18:05:46 »
OK. Thanks for info.
I hope you can provide some fix for this.
-Pawel

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: Multi Commander Custom Menu (issues!)
« Reply #7 on: August 10, 2018, 12:53:46 »
Try latests build  2469,, limit is now a lot bigger so you should not run into that limit anymore

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Multi Commander Custom Menu (issues!)
« Reply #8 on: September 10, 2018, 17:42:47 »
It is now fixed. Thanks Mathias!

Here is my UFM project that uses a lot of menu entries :)
https://www.pawelporwisz.pl/ufm/download_en.php

Best regards,
-Pawel