[solved] Env. variables in iconlib filenames not fully resolved

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

[solved] Env. variables in iconlib filenames not fully resolved

Post by *petermad »

I had originally put this in the TC Suggestions section, but since some resolving of environment variables in iconlib file names does already take place (see bold here under) I think it qualifies as a bug.

It seems that TC is already resolving the env. variable but only for the Button bar, not for the Main menu, and not for the .inc file.

Current behaviour when selecting wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll under TC x64:
Icons used in Button bar: wcmicon_win7amd64.dll
Inc file used in Button bar: wcmicon_win7%PROCESSOR_ARCHITECTURE%.inc (if existing)

Icons used in Main menu: wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll
Inc file used in Main menu: wcmicon_win7%PROCESSOR_ARCHITECTURE%.inc (if existing)

Expected behaviour:
Icons used in Button bar: wcmicon_win7amd64.dll
Inc file used in Button bar: wcmicon_win7amd64.inc (if existing)

Icons used in Main menu: wcmicon_win7amd64.dll
Inc file used in Main menu: wcmicon_win7amd64.inc (if existing)


In other words - if I distribute a package with these 5 files:
wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll
wcmicon_win7amd64.dll
wcmicon_win7amd64.inc
wcmicon_win7x86.dll
wcmicon_win7x86.inc

and I in the "Icon library" dialog select the item:
wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll; Icons for Extended Menus for Win 7 32bit
then TC x64 should use wcmicon_win7amd64.dll and wcmicon_win7amd64.inc
while TC 32bit should use wcmicon_win7x86.dll and wcmicon_win7x86.inc

testpackage: http://madsenworld.dk/tcmd/iconlib.zip[/url]
Last edited by petermad on 2021-05-30, 11:49 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

15.11.16 Fixed: Environment variables were not working in [buttonbar] DefaultLib entry (32/64)
It still isn't fixed - it still works like described above.

The environment variable for the .INC file is not resoved for both buttonbar and main menu and not for the .DLL file either for tyha main menu

I can make a step-by-step explanation as to what I mean if necessary.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Could you try with TC 32-bit? It looks like I didn't port it to 64-bit.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ghisler(Author)
Could you try with TC 32-bit? It looks like I didn't port it to 64-bit.
It is the same in the 32bit version. To make sure we are talking about the same try this:

1. Download http://madsenworld.dk/tcmd/iconlib2.zip
2. Unpack the content of iconlib2.zip to a combined 32bit and 64bit installation of TC under Windows 7 x64.
3. Start TC9 x64
4. In the language configuration choose: "English with Extended Menu II for TC 9.0 32/64bit under Windows 7 64bit (wcmd_win7%PROCESSOR_ARCHITECTURE%_2_eng.lng)"

5. Right click on the buttonbar and choose "Select default icon library" and then select "wcmicon_win7amd64.dll (Old icons, 4 sizes)".

6. Right click on the buttonbar and choose "Change"
7. Click the add button
8. Click the magnifying glass button and choose the cm_CustomColumnConfig command
9. TC now suggest the Hammer icon (icon 0034) because of the 483=34 entry in the wcmicon_win7amd64.inc file - as expected.

10. Open the "Misc." item in the Main menu and notice that all the menu items has icons, and that the menu item "Swap two filenames" uses the Green back-and-forth icon (icon 0000).

So far so good.

11. Now right click on the buttonbar and choose "Select default icon library" and now select wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll (Old icons, 4 sizes)".

12. Perform step 6, 7 and 8 again.
13. TC now suggest the Hex wrench icon (icon 0056) because of the 483=56 entry in the wcmicons.inc file. Obviously the wcmicon_win7amd64.inc is NOT used - as it should be.

So choosing wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll as default library does not result in wcmicon_win7amd64.inc being used as it should in the Buttonbar.

14. Open the "Misc." item in the Main menu again and notice that now NONE of the menu items has icons.
The wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll file has only one icon (icon 0000) and because the file itself is used and not the file wcmicon_win7amd64.dll is used (as expected) the only icon shown all ower the Main menu is icon no. 0 ("Mark" -> "Reread Source" and "Commands" -> "Reread Source").

So choosing wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll as default library does not result in wcmicon_win7amd64.dll being used as it should in the Main menu.


Also the fact that there is no icon shown for "Misc" -> "Swap two filenames" - indicates that wcmicon_win7amd64.inc is not being used, otherwise the green icon 0000 should have been shown.

So choosing wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll as default library does not result in wcmicon_win7amd64.inc being used as it should in the Main menu.


I hope this helps claryfying the problem...
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will try that - all I tried was setting
DefaultLib=wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll

manually and restarting TC, and that worked for me. The Env vars are only converted when TC starts, not when choosing a library via the chooser dialog for now.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

The Env vars are only converted when TC starts, not when choosing a library via the chooser dialog for now.
I see that now for the 32bit version. But I also see that when DefaultLib=wcmicon_win7%PROCESSOR_ARCHITECTURE% is set in wincmd.ini, then when you open the chooser dialog it shows that wcmicon_win7x86.dll is currently being used - it should show that wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll is being used. Otherwise if I open the chooser dialog to check the setting and just press OK then DefaultLib=wcmicon_win7x86 is unintentionally set in wincmd.ini in stead of wcmicon_win7%PROCESSOR_ARCHITECTURE%.

While testing this, leads me to point your attention to this http://www.ghisler.ch/board/viewtopic.php?t=46275 request.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

As I wrote, the env vars are replaced by their content when TC starts, so you get wcmicon_win7x86 when you open the chooser dialog.

Currently I don't plan to change this because it would need a LOT of code changes, delaying the release by at least 2-3 weeks. For example, the preview in the chooser dialog would also have to use the wcmicon_win7x86.dll when the user clicks on wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll etc.

I will add the env var replacement when the user clicks on "OK" in the chooser dialog, though.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Will it be possible that the chooser, when opened, shows wcmicon_win7%PROCESSOR_ARCHITECTURE%.dll as chosen if DefaultLib=wcmicon_win7%PROCESSOR_ARCHITECTURE% is set in wincmd.ini - it will be less confusing for the user if the shown value and the stored value is the same.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, since the env vars have been replaced at this point, TC cannot know the original name. I could re-load it from the ini, but then it may have been changed outside of TC in the meantime.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I could re-load it from the ini
I think that is a good idea.
but then it may have been changed outside of TC in the meantime.
That's just hypothetical.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

It looks like I didn't port it to 64-bit.
It now also works for 64bit version in TC9.0final :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes I did! I also apply the env vars after using the icon library choose dialog now. However, I do not try to re-load the name with variable before opening the dialog, so the dialog will show which library is actually used.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

However, I do not try to re-load the name with variable before opening the dialog, so the dialog will show which library is actually used.
Maybe for the next version, then...
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply