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

Generated shim has an ugly icon #12

Open
kodemeister opened this issue Aug 30, 2023 · 1 comment · May be fixed by #13
Open

Generated shim has an ugly icon #12

kodemeister opened this issue Aug 30, 2023 · 1 comment · May be fixed by #13

Comments

@kodemeister
Copy link

kodemeister commented Aug 30, 2023

  1. Make a shim pointing to any app with icon, say Notepad:
shmake.exe -i notepad.exe -o sample.exe
  1. Open Explorer and check the mirrored icon of the generated shim. It looks much worse compared to the original one.

icons

I suspect this happens because shmake doesn't copy icon groups from the input executable. According to docs, Windows chooses the most appropriate icon to display based on icon groups but not plain icon resources.

Let's inspect the resources of Notepad app:

notepad

As we see, Notepad has an icon group with ID 2 containing thirteen icons of various resolutions, including high quality ones.

Now the generated shim:

sample

There is an icon group with ID 101 containing only three low-res icons. That's why the generated shim appears ugly in Explorer.

Where did the icon group 101 come from? It is actually a leftover from the win-shim's default "umbrella" icon. Initially it contained three umbrella icons of resolutions 32x32, 64x64 and 256x256. During the shim creation umbrella icons were overwritten by Notepad icons. Now the icon group 101 points to the first three Notepad icons of much lower resolution. It is what causes the ugly appearance.

In summary, I believe shmake should copy icon groups from the input executable (numbered 2, 300, 301 and 302 in our particular case) and also remove umbrella icon group 101 to avoid unwanted leftovers and glitches.

@kodemeister kodemeister linked a pull request Aug 30, 2023 that will close this issue
@mnivet
Copy link
Contributor

mnivet commented Oct 10, 2023

I’ve experienced the same issue. But since our need of shim.exe is on executables we compile ourself, for now we have just aligned the icons Embedded in our exe to match the icon groups from shim.exe.

I’ll be happy to see the fix to that issue officially integrated.

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.

2 participants