Updated program icon is not properly reflected

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, Stefan2, white

Post Reply
User avatar
yyang
Member
Member
Posts: 119
Joined: 2007-03-27, 11:41 UTC
Location: China

Updated program icon is not properly reflected

Post by *yyang »

Steps to reproduce:

1. Build a program with a linked program icon resource A.
2. Use a different icon B and rebuild the program.
3. If the program path doesn't change, it still shows icon A in full view and (worse) the Alt+Enter dialog.

Windows explorer always reflects the icon update. And the icon will be properly shown in Total Commander if the program uses a new path.

This issue is roughly the same when the "Show icons to the left of the filename" option is set to "All associated + EXE/LNK (slow)" or "All associated".
#147523
User avatar
petermad
Power Member
Power Member
Posts: 11676
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Updated program icon is not properly reflected

Post by *petermad »

Probably due to Windows' icon cache:

Related topics:
viewtopic.php?t=77244
viewtopic.php?p=364898#p364898
viewtopic.php?p=383563#p383563
License #524 (1994)
Danish Total Commander Translator
TC 10.50 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (21H2) 64bit, 'Everything' 1.4.1.1017 (x64)
TC 3.40b2 on Android 6 & 12
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
yyang
Member
Member
Posts: 119
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: Updated program icon is not properly reflected

Post by *yyang »

Thanks for your help! This is indeed the same problem. And Windows Explorer doesn't work better (I was wrong in the original post).

As other users may suggest, I think a command is desirable to "fully reload" resources, directly from the files, at any cost. Better than repeatedly restarting Total Commander. (Reopening Windows Explorer feels more acceptable, because it's much less useful, often annoying to see, and thus cheaper.)
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43400
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Updated program icon is not properly reflected

Post by *ghisler(Author) »

Unfortunately there is no such command - the only thing that helps is restarting Total Commander, which can be done with a tool like Tinny TC Restarter:
http://totalcmd.net/plugring/tinnytcrestarter.html

It works even with TC 64-bit with a button command like this:
"C:\path to\TinnyTCRestarter\TinnyTCRestarter.exe" 1000 "c:\path to Total Commander\totalcmd64.exe"
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 11676
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Updated program icon is not properly reflected

Post by *petermad »

No need for third party tools - for restart of TC I use this in my usercmd.ini:

Code: Select all

[em_newcommander]
cmd=%COMSPEC% /C
param=%Z%X start "" "%%COMMANDER_EXE%%" /N /P /A /i="%%COMMANDER_INI%%" %P%N* %T%M*
menu=Open new instance of Total Commander
button=%COMMANDER_EXE%

[em_restartcommander]
cmd=em_newcommander, cm_Exit
menu=Restart Total Commander
button=%COMMANDER_EXE%
And then a button in the button bar with the em_restartcommander command.

These command open/reopen TC in the same dirs as it was in, and with the cursor on the same items - even if Save Directories on exit is not enabled in TC's Operation options.


you can also use:

Code: Select all

[em_newcommander]
cmd=%COMMANDER_EXE% /N /P /A /i="%COMMANDER_INI%"
param=%Z%X %P%N* %T%M*
menu=Open new instance of Total Commander
button=%COMMANDER_EXE%
but this one alters the instance number in TC's Title when used in em_restartcommander
License #524 (1994)
Danish Total Commander Translator
TC 10.50 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (21H2) 64bit, 'Everything' 1.4.1.1017 (x64)
TC 3.40b2 on Android 6 & 12
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
yyang
Member
Member
Posts: 119
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: Updated program icon is not properly reflected

Post by *yyang »

Thanks for the detailed reply! I like your way better.

To avoid the ephemeral console window, I write a tiny GUI program that launches Total Commander maximized (as my preference). My configuration looks like:

Code: Select all

[em_NewCommander]
cmd=runmax.exe "%COMMANDER_EXE%"
menu=Open new instance of Total Commander
button=%COMMANDER_EXE%

[em_RestartCommander]
cmd=em_NewCommander, cm_Exit
menu=Restart Total Commander
button=%COMMANDER_EXE%
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43400
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Updated program icon is not properly reflected

Post by *ghisler(Author) »

The problem with this approach is that the new commander may start before the old one has had the opportunity to save its paths, tabs and other settings. That's why there is a delay of 1000 ms (one second) in tinnytcrestarter. On older PCs or when using slow virus scanners, 1 second may not be enough, so you may need to increase the value if the restarted TC doesn't get the previous paths and tabs.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 11676
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Updated program icon is not properly reflected

Post by *petermad »

2ghisler(Author)
My experience is that if I use:

Code: Select all

[em_newcommander]
cmd=%COMSPEC% /C
param=%Z%X start "" "%%COMMANDER_EXE%%" /N /P /A /i="%%COMMANDER_INI%%" %P%N* %T%M*
using the command processor's "start" parameter, then there is no problem saving paths and tabs.
License #524 (1994)
Danish Total Commander Translator
TC 10.50 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (21H2) 64bit, 'Everything' 1.4.1.1017 (x64)
TC 3.40b2 on Android 6 & 12
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
yyang
Member
Member
Posts: 119
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: Updated program icon is not properly reflected

Post by *yyang »

@ghisler Thanks for your advice! On my laptop I find it quick enough to save everything and use the original instance number (at least it appears so).
#147523
Post Reply