conda / menuinst

Cross platform menu item installation
https://conda.github.io/menuinst/
BSD 3-Clause "New" or "Revised" License
33 stars 41 forks source link

Display a friendlier name for "Open With" menus in Windows #225

Closed jaimergp closed 11 hours ago

jaimergp commented 3 days ago

Description

Hoping this fixes the issue reported at https://github.com/conda/menuinst/issues/185#issuecomment-2197286218

Checklist - did you ...

jaimergp commented 3 days ago

pre-commit.ci autofix

mrclary commented 3 days ago

I'll give this a try locally.

mrclary commented 3 days ago

It did not appear to affect anything. I can see that the registry entry is different

Screenshot 2024-07-01 at 12 28 04 PM

but the associated application is still "Python", and "Spyder (spy6b3d10)" does not appear in any application list to choose from.

Screenshot 2024-07-01 at 12 29 18 PM
jaimergp commented 2 days ago

Oh, I do see it in the "Details column" there in the background, next to the file size. Maybe that's what they meant with FriendlyTypeName?

jaimergp commented 2 days ago

I found what VS Code uses for PY files so I'm going to give it a try now with a couple commits. I don't have a Windows VM around right now so it's going to be a blind guess. I appreciate the patience here, thanks!

jaimergp commented 2 days ago

With the latest push I can successfully display a "pretty name" for the executable (instead of Python). Unfortunately, looks like the icon logic is hardcoded to whatever the executable is shipping, so the only way around that is to create a forwarder shim equipped with the icon that knows how to call the actual program... a bit hacky 😬

mrclary commented 2 days ago

Commit 006c579 looks much better 🎉

The "Open with" context menu still shows the Python icon but has the correct name; the "Choose another app" dialog shows the correct name and icon, and the File Explorer shows the correct icon for the file after assignment.

Screenshot 2024-07-02 at 7 50 47 AM Screenshot 2024-07-02 at 7 51 23 AM Screenshot 2024-07-02 at 7 49 42 AM
jaimergp commented 1 day ago

I think that's the best we can do for now... :/ The "Open With" icon is going to default to the EXE icon, no matter what. I'll mark this as ready so we can start the review.