Skip to content

Support exe/dll paths in the 'icon' setting #1504

Closed

Description

@fpintos

Support exe/icon paths in the 'icon' setting of a profile

The icon setting of a profile should allow the path to an EXE or DLL to be specified, along with an optional ID for an icon resource in the file.

For example, I should be able to create a profile using icons from SHELL32:

    ...
    "icon": "c:\Windows\System32\SHELL32.dll,210",
    ...

Optionally, if the icon is missing and the executable from the command line has icons, pick the default icon, much like how the shell does.

Activity

  1. added
    Issue-Feature
    on Jun 24, 2019
  2. ghost added
    Needs-Triage
    on Jun 24, 2019
  3. ghost added
    Needs-Tag-Fix
    on Jun 24, 2019
  4. Karl-WE commented on Jun 25, 2019

    @Karl-WE

    I agree. or things like "icon": "C:\Program Files\PowerShell\6-preview\pwsh.exe",

  5. DHowett-MSFT commented on Jun 27, 2019

    @DHowett-MSFT
    Contributor

    Yeah, it would be pretty cool if we did this.

  6. added
    Area-Settings
    Help Wanted
    Issue-Task
    Product-Terminal
    and removed
    Needs-Triage
    on Jun 27, 2019
  7. ghost removed
    Needs-Tag-Fix
    on Jun 27, 2019
  8. removed
    Issue-Feature
    on Jun 27, 2019
  9. DHowett-MSFT commented on Jun 27, 2019

    @DHowett-MSFT
    Contributor

    Notes: Right now we're using the XAML resource loader to get at our icons. If we want to support EXE/other PE resources we'll need to fall back to a more win32-like resource loader. There are real benefits to the XAML one, such as it choosing the right icon scale and supporting vector graphics and stuff like that. I've tagged it help-wanted.

  10. Karl-WE commented on Jun 28, 2019

    @Karl-WE

    Dustin L. Howett (MSFT) (@DHowett-MSFT) afaik not even the settings app in Windows uses SVG graphics but PNGs. I stumbled across them once. I see the point of having this more modern and getting rid of old ico restrictions.

  11. 4 remaining items

  12. zadjii-msft commented on May 24, 2022

    @zadjii-msft
    Member

    Notes from some tabs I had open for the last few weeks:

    Still not sure if that connects up to a BitmapImage. Maybe I should look in the BitmapImage source itself - it can apparently read from .ico files, so there's probably some overlap between reading an .ico and reading an HICON.

    More notes:

    • Window::s_RegisterWindowClass is where we set the HICON for the console window.
    • This is unpacked in Icon::GetIcons, after a call to:
    • Icon::LoadIconsFromPath, in win32/SystemConfigurationProvider::GetSettingsFromLink (see also Console icon? #11759)
      • first check: ShortcutSerialization::s_GetLinkValues
        • ShortcutSerialization::s_GetLoadedShellLinkForShortcut to load the IShellLink for the lnk
        • psl->GetIconLocation to load the icon from the IShellLink.
      • Then, we fall back to the title?
      • SystemConfigurationProvider::GetSettingsFromLink sets the icon GLOBALLY. It probably initializes other state. If we want to reuse that to pull the icon out of an lnk before handoff, the we should be SURE it's not setting any other magic global state. We can use a dummy console Settings to hold data if need be.
    • see 1dd6e99
  13. zadjii-msft commented on Sep 9, 2022

    @zadjii-msft
    Member
  14. ghost added
    In-PR
    on Sep 30, 2022
  15. ghost closed this as completedin #14107on Oct 26, 2022
  16. ghost added a commit that references this issue on Oct 26, 2022
    aa62509
  17. ghost removed
    In-PR
    on Oct 26, 2022
  18. ghost added
    Resolution-Fix-Committed
    on Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-SettingsHelp WantedIssue-TaskProduct-TerminalResolution-Fix-Committed

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions