Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taskbar icon after pinning the program reverts to default ConEmu icon. Systray icon is always ConEmu's. #154

Closed
dcominottim opened this issue Feb 25, 2014 · 93 comments
Assignees

Comments

@dcominottim
Copy link

First of all, congratulations on your great customization and integration work! Cmder is a true visual joy. :-) As for the report, the issue can be easily reproduced just by 1) launching Cmder, right-clicking its icon on the taskbar, and choosing "Pin this program...", and 2) looking also at the systray icons.

@sc0tt
Copy link
Contributor

sc0tt commented Feb 25, 2014

Windows 7, 8, 8.1?

@dcominottim
Copy link
Author

I am sorry for not specifying it earlier: it's Windows 7.

@PendragonDevelopment
Copy link

Does this in Win8x64 as well.

@sc0tt
Copy link
Contributor

sc0tt commented Feb 26, 2014

Could you provide a screenshot, I can't seem to reproduce it. Thanks.

@PendragonDevelopment
Copy link

conemuicon
Right between Sublime and Google Drive.

@sc0tt
Copy link
Contributor

sc0tt commented Feb 26, 2014

Can you confirm you are using Version 1.1.3 (https://github.com/bliker/cmder/releases/tag/v1.1.3) or 1.1.4?

@PendragonDevelopment
Copy link

1.1.3, just downloaded it this morning.

@dcominottim
Copy link
Author

I am using 1.1.3, too. Also, please note that the systray comment refers to a similar but separate issue. In order to see it, you should minimize Cmder's window.

systray

@kohenkatz
Copy link
Contributor

The executable launcher in 1.1.4 fixes this problem.

(The problem is caused by the fact that the old launcher was just a batch file that started the ConEmu executable, so it was that executable that got pinned. With a real executable launcher, the proper thing gets pinned.)

@dcominottim
Copy link
Author

That seems strange to me. 1.1.3 does have a "true" launcher in that it is a real executable launcher (Cmder.exe), and there are no batch files -- except for setting aliases and environment details. Have all the steps I mentioned been tested with the upcoming 1.1.4 version? (Also, when should its binaries be available?)

@kohenkatz
Copy link
Contributor

That'll teach me to comment without double checking the numbers. I was thinking of 1.1.2 which is the last version with the batch scripts. This works perfectly for me in 1.1.3.

@kohenkatz
Copy link
Contributor

@dcominottim You can also try the modified launcher that I built for #159, and see if you still have a problem using that one. You can get just that file from https://github.com/kohenkatz/cmder/raw/fix-context-menu/Cmder.exe

@ghost
Copy link

ghost commented Jul 19, 2014

This problem still persists on latest Windows 8.1. I'm using the modified launcher built for #159 - still happening.

@ghost
Copy link

ghost commented Jul 19, 2014

And this is not the only problem. It's even worse: After pinning, and exiting Cmder... if you click the pinned icon (which is the ConEmu's one) then ConEmu is launched, instead of Cmder.

@nloding
Copy link

nloding commented Jul 23, 2014

I am having the same issue that @DEVTIME is having on Windows 8.1. If the Cmder.exe is pinned, it spawns new windows for ConEmu. If you pin the running task, it pins ConEmu rather than Cmder, losing all the awesomeness of Cmder.

@kohenkatz
Copy link
Contributor

I have two Windows 8.1 computers, and this works properly on one of them but not the other. I will try to see if I can compare them and figure out the difference.

@dcominottim
Copy link
Author

When I first posted about this issue, I was using Windows 7 Professional x64; but it has always been reproducible on my Windows 8/8.1 Pro x64 installation, too (even with the launcher from #159).

@lowjoel
Copy link

lowjoel commented Aug 17, 2014

If I pin the launcher, and click on it, I'll get a new window. This is Windows 8.1 x64 (using 1.1.3, and also the launcher from #159).
untitled

@MartiUK
Copy link
Member

MartiUK commented Aug 17, 2014

I'm not experiencing this, I've pinned cmder.exe from the 1.1.3 release.

2014-08-17 15_28_42-

@lowjoel
Copy link

lowjoel commented Aug 17, 2014

Looking at the source of the launcher it looks like it's doing the right thing. Meh, I don't have time to debug this right now...

@lowjoel
Copy link

lowjoel commented Aug 17, 2014

@MartiUK I've not used the taskbar management APIs recently, so my memory is kinda hazy; but in the launcher shouldn't the AppID be retrieved using GetCurrentProcessExplicitAppUserModelID instead of the current exe path?

[edit: MSDN says that this only works if an explicit ID was set beforehand, and that there's no way to retrieve the system-assigned ID. possibly this is not working because my system has assigned some other ID to the launcher?]

@MartiUK
Copy link
Member

MartiUK commented Aug 17, 2014

@lowjoel From what I understand, Conemu retrieves the icon and config through CreateProcess. The STARTUPINFO and PROCESS_INFORMATION is passed through this as well. This hasn't changed since it was first commited by @austinwagner so using the launcher from #159 shouldn't have broken this.

I'll have to look into why this is not working for some, I think it may be something to do with https://github.com/bliker/cmder/blob/master/launcher/src/CmderLauncher.cpp#L13

@lowjoel
Copy link

lowjoel commented Aug 17, 2014

@MartiUK hope you make progress on this... I'll see if I can somehow debug this too. Thing is, both the released version and the pre-release fix version doesn't work in this manner.

@lowjoel
Copy link

lowjoel commented Aug 24, 2014

@MartiUK I've found the culprit.

This problem manifests because we are reverse-engineering Microsoft's AppID generation technique. Pinning EXE's generally result in the path stored as the AppID, but when the program pinned is in the Program Files folder, the KnownFolderID is used instead. Launcher is a 32-bit app, so placing it in Program Files (x86) on a x64 Windows install will use the 32-bit known folder ID.

I have a patch which substitutes the path with Known Folder IDs. But if Cmder is put in the 64-bit Program Files folder on a x64 Windows install the same problem will manifest. Because to the 32-bit app, the 64-bit Program Files directory isn't special.

If I place Cmder in my user profile, with my patch, it'll break once again, because apparently Explorer doesn't substitute my user profile path with the Known Folder ID...

I'll push a patch which fixes the Program Files problem. We need a better way of fixing this however.

@kohenkatz
Copy link
Contributor

@lowjoel I wonder if that is not the only issue - on both of my computers, Cmder is installed in C:\Programs\ because that is where I put all programs that are "extract-and-drop". However, as mentioned, it works on one but not the other.

@lowjoel
Copy link

lowjoel commented Aug 25, 2014

@kohenkatz Can you do a taskbar inspection and share with us your findings? This fixes it on both my computers (I use the one with 7+ Taskbar Tweaker)

@kohenkatz
Copy link
Contributor

Here are my findings:

  • On the computer that works properly, the Inspector shows that the Pinned Icon points to C:\Programs\cmder\cmder.exe and the running executable is the same.
  • On the other computer, the behavior is very weird:
    • If the program is not pinned, then when I run it, the Inspector shows the correct path (same as above). If I right-click and choose "Pin", the path in the Inspector stays the same but the plain ConEmu shortcut is pinned. If I then unpin the incorrect shortcut again, the path in the Inspector changes to be blank.
    • If I pin the program manually before I run it (by dragging from Windows Explorer onto the taskbar), then the Application ID of the pinned icon is {B07861F7-51BF-4106-B2A4-DA00BECC485C}\Cmder.exe! However, when I click it, the running application has the expected Application ID - C:\Programs\cmder\cmder.exe - which causes a second icon to be created.

The only other place that I can find this GUID is in the Shortcut that was created when I did "Pin to Start" - it appears that dragging the program from Explorer just gets a copy of that shortcut. Dumping the .lnk file using lnk-parser, I see that the field in the shortcut that sets contains this value is named System.AppUserModel.ID. More testing shows that when I program is pinned to the Start Screen, Windows assigns it a GUID. If the same program is then pinned to the Taskbar, Windows uses the same GUID for its App ID.

Unpinning Cmder from the Start Screen, pinning it to the Taskbar, and then repinning it to the Start Screen has solved my problem.

@arthurspa
Copy link

@jacobch, your solution works!! I'm using Windows 8.1 64 bits.

=)

@RDugan23
Copy link

@Stanzilla Why was this closed? It's still an issue. Non of the above worked for me. I'm on Window 10

@Stanzilla
Copy link
Member

@RDugan23 I tested it on Win10 and it works. You have to right click cmder.exe in the cmder folder and pin it. then works fine, stays as one (the correct) icon. This is was with the development branch code. If you want to test a build, get this one https://github.com/Stanzilla/cmder/releases/tag/1.2.6

@RDugan23
Copy link

@Stanzilla Thank you for your help. Using your build I was able to get it working. One change I had to make, though, was with the vendor/init.bat file. Using the bat file that came with your build the 'ls' command wouldn't work. I had to revert that file back to my old version and the 'ls' command began working again. Let me know if you want more info. Again, thank you for all of your hard work and your help! :)

@0xhmn
Copy link

0xhmn commented Oct 13, 2015

still have the same problem that mentioned by other people on Windows 10.

@Stanzilla
Copy link
Member

@hmny what exactly? did you try it the way I mentioned and with the version I mentioned?
@RDugan23 what exactly did you have to change?

@RDugan23
Copy link

@Stanzilla Somehow I messed things up so I did a fresh install with you latest build and everything seems to be working now. I don't know what I did wrong last time. Thanks again for your help.

@Stanzilla
Copy link
Member

Sounds great :)

@winston01
Copy link

How will this work in the new release, where - as I can see - there is no cmder.exe, but Cmder.bat which launches ConEmu.exe, and I don't see a way of that not appearing as a separate icon on the task bar? Does anyone have a solution?

@winston01
Copy link

Sorry, I just saw this was closed. Anyway, the question is still valid.

@kohenkatz
Copy link
Contributor

@winston01 I'm not sure where you got the idea that the new release has no cmder.exe. The source files of the executable still exist in the Git repository, just not a built version of the executable. If you check out the code from Git instead of downloading the release zip files, you will have to build the executable yourself.

@winston01
Copy link

@kohenkatz I was testing the development branch and that one does not build the executable.

@kohenkatz
Copy link
Contributor

@winston01 you have to compile the executable yourself when you are on the development branch. Look in the launcher folder in the source for the code.

@winston01
Copy link

@kohenkatz Thx for you help, I have the Cmder.exe now!

@liulex
Copy link

liulex commented Jan 3, 2016

Sadly none of the above worked for me too, on Windows 10 x64, but I figure out one myself.

  • Run cmder.exe.
  • Pin the running program.
  • Right click on the pinned taskbar icon, then right click on the program name (should be "Console Emulator (x86)"), select "Property".
  • In the Property window, you may see that the target is "xxx\cmder\vendor\conemu-maximus5\ConEmu.exe". Change it into "xxx\cmder\Cmder.exe".
  • Done!

@ksubileau
Copy link

@liulios This works for me too on Windows 10, but this has already been said by @mikesigs here ;)

@liulex
Copy link

liulex commented Jan 3, 2016

@ksubileau Oops! I missed it :)

@Frankusky
Copy link

Frankusky commented Feb 12, 2018

Sorry for bump this, but the issue still alive (also the right click menu on the task bar doesnt appears) on windows 7 64bits. I was able to fix this using @nogwater fix but would be nice that you can fix this without going with workarounds 😅

@mikesigs
Copy link
Contributor

I found another fix for this. Right-click Cmder.exe and then Pin to Start. Then find it in the Start Menu and right-click it and Pin to Taskbar.

@ghost
Copy link

ghost commented Apr 15, 2018

@mikesigs thank you so very much. Your 'fix' worked wonderfully.

@sixpetrov
Copy link

You can also create shortcut on the desktop and then "Pin to taskbar"

@ryan-z
Copy link

ryan-z commented Aug 8, 2018

The above tricks do not work if there is no running cmder instance and launching "cmd" from the run dialog (cmder is my default terminal)

@PlugaruT
Copy link

This issue is still present on Windows 10

@core1983
Copy link

On Windows 10 Pro I just right click on cmder.exe and choose pin to taskbar. Just it! Now work like a charm :-)

@saboco
Copy link

saboco commented Oct 20, 2018

Here are my findings:

* On the computer that works properly, the Inspector shows that the Pinned Icon points to `C:\Programs\cmder\cmder.exe` and the running executable is the same.

* On the other computer, the behavior is very weird:
  
  * If the program is not pinned, then when I run it, the Inspector shows the correct path (same as above).  If I right-click and choose "Pin", the path in the Inspector stays the same but the plain `ConEmu` shortcut is pinned.  If I then _unpin_ the incorrect shortcut again, the path in the Inspector changes to be **blank**.
  * If I pin the program manually before I run it (by dragging from Windows Explorer onto the taskbar), then the Application ID of the pinned icon is `{B07861F7-51BF-4106-B2A4-DA00BECC485C}\Cmder.exe`!  However, when I click it, the running application has the expected Application ID - `C:\Programs\cmder\cmder.exe` - which causes a second icon to be created.

The only other place that I can find this GUID is in the Shortcut that was created when I did "Pin to Start" - it appears that dragging the program from Explorer just gets a copy of that shortcut. Dumping the .lnk file using lnk-parser, I see that the field in the shortcut that sets contains this value is named System.AppUserModel.ID. More testing shows that when I program is pinned to the Start Screen, Windows assigns it a GUID. If the same program is then pinned to the Taskbar, Windows uses the same GUID for its App ID.

Unpinning Cmder from the Start Screen, pinning it to the Taskbar, and then repinning it to the Start Screen has solved my problem.

I repro this issue on Windows 10 Pro Version 1803 OS build 17134.345.
But pinning to start first solves my problem as well.

@lawweiliang
Copy link

Solution.

  1. Right click the Cmder.exe to 'pin to start'
  2. Then, run Cmder.exe
  3. Then, 'pin to taskbar'

@ZodmanPerth
Copy link

  1. Right click the Cmder.exe to 'pin to start'
  2. Then, run Cmder.exe
  3. Then, 'pin to taskbar'

Before you do this, make sure you've deleted any previous "pin to start" shortcut:

  1. Open run dialog and run shell:startup
  2. Navigate up one folder (to Programs)
  3. Delete any Cmder shortcut there

Now if you follow the steps from @lawweiliang it works.
(Tested on Windows 11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.