How can I ship an icon (or font) in a fragment in a MSIX? #14155

Closed
opened 2026-01-31 04:02:22 +00:00 by claunia · 12 comments
Owner

Originally created by @davidanthoff on GitHub (Jun 8, 2021).

I am now shipping a profile fragment in the Julia MSIX Windows Store installer here. It works great! I still have one question, though: how can I ship an icon in my fragment that will be used? I tried putting an icon file next to the fragment json and then just adding "icon": "julia.ico" to the fragment, but with that it complained that it couldn't find the icon.

I think I need some way to specify a relative path here that is relative to the fragment file location, right? Is there some way to do that?

Originally created by @davidanthoff on GitHub (Jun 8, 2021). I am now shipping a profile fragment in the Julia MSIX Windows Store installer [here](https://www.microsoft.com/store/apps/9NJNWW8PVKMN). It works great! I still have one question, though: how can I ship an icon in my fragment that will be used? I tried putting an icon file next to the fragment json and then just adding `"icon": "julia.ico"` to the fragment, but with that it complained that it couldn't find the icon. I think I need some way to specify a relative path here that is relative to the fragment file location, right? Is there some way to do that?
claunia added the Area-SettingsIssue-TaskNeeds-Tag-FixProduct-Terminal labels 2026-01-31 04:02:22 +00:00
Author
Owner

@skyline75489 commented on GitHub (Jun 8, 2021):

Check out the blog which introduces the fragments integration of Pengwin WSL. They managed to bring both icon & background image alongside the installation.

@skyline75489 commented on GitHub (Jun 8, 2021): Check out [the blog](https://www.whitewaterfoundry.com/blog/2021/5/21/pengwin-2105-released-see-whats-new) which introduces the fragments integration of Pengwin WSL. They managed to bring both icon & background image alongside the installation.
Author
Owner

@skyline75489 commented on GitHub (Jun 8, 2021):

The exact code is this one, I think.

@skyline75489 commented on GitHub (Jun 8, 2021): The exact code is [this one](https://github.com/WhitewaterFoundry/Pengwin/blob/master/Pengwin/Public/Fragments/pengwin.json), I think.
Author
Owner

@davidanthoff commented on GitHub (Jun 8, 2021):

Hm, interesting... That does seem to work, but it also seems a bit hacky? What they are doing is copying the icon file at startup of the program into the local app data location (which I think means it will only work once everything has run once), and then they have semi hard coded the path to where MSIX is storing local app data in the fragment for the icon path. That latter step is probably not a good idea? Isn't that file location considered an implementation detail of MSIX? Essentially they are using a special path to reach into the container of their app, which seems not in the spirit of MSIX.

Is there maybe a way to do the same thing in a less involved way? Couldn't the terminal just be able to interpret relative paths from the fragment?

@davidanthoff commented on GitHub (Jun 8, 2021): Hm, interesting... That does seem to work, but it also seems a bit hacky? What they are doing is copying the icon file at startup of the program into the local app data location (which I think means it will only work once everything has run once), and then they have semi hard coded the path to where MSIX is storing local app data in the fragment for the icon path. That latter step is probably not a good idea? Isn't that file location considered an implementation detail of MSIX? Essentially they are using a special path to reach into the container of their app, which seems not in the spirit of MSIX. Is there maybe a way to do the same thing in a less involved way? Couldn't the terminal just be able to interpret relative paths from the fragment?
Author
Owner

@skyline75489 commented on GitHub (Jun 8, 2021):

Yeah .. I wouldn't say "semi hard coded" path is a good idea or an elegant solution, either. I'll leave this to @DHowett and @PankajBhojwani

@skyline75489 commented on GitHub (Jun 8, 2021): Yeah .. I wouldn't say "semi hard coded" path is a good idea or an elegant solution, either. I'll leave this to @DHowett and @PankajBhojwani
Author
Owner

@WSLUser commented on GitHub (Jun 9, 2021):

You know this also raises the question for me of whether you can import a fragment yourself as a user. Say you import the rootfs of Pengwin and install it through the wsl --import option. You won't be able to obtain the fragment through the Store as a result of this method. Perhaps I should raise an issue for this if there isn't one already. This would also affect Julia and any other third party application, especially those that aren't available in the Store.

@WSLUser commented on GitHub (Jun 9, 2021): You know this also raises the question for me of whether you can import a fragment yourself as a user. Say you import the rootfs of Pengwin and install it through the `wsl --import` option. You won't be able to obtain the fragment through the Store as a result of this method. Perhaps I should raise an issue for this if there isn't one already. This would also affect Julia and any other third party application, especially those that aren't available in the Store.
Author
Owner

@mpela81 commented on GitHub (Jun 10, 2021):

I guess #6747 would be helpful (but probably not easy to implement), you could embed the icon into the json itself without worrying about file paths

@mpela81 commented on GitHub (Jun 10, 2021): I guess #6747 would be helpful (but probably not easy to implement), you could embed the icon into the json itself without worrying about file paths
Author
Owner

@DHowett commented on GitHub (Jul 6, 2021):

This is an excellent question. I somewhat wonder if icon resource paths like ms-appx://My.PackageName_myPublisher/Public/XYZ work...

If they do: cool, the first free thing we've gotten from the app platform.

If not: I think we will want to add manual support for something like it.

@DHowett commented on GitHub (Jul 6, 2021): This is an excellent question. I somewhat wonder if icon resource paths like `ms-appx://My.PackageName_myPublisher/Public/XYZ` work... If they do: cool, the first free thing we've gotten from the app platform. If not: I think we will want to add manual support for something like it.
Author
Owner

@davidanthoff commented on GitHub (Jul 6, 2021):

I'm trying that now!

@davidanthoff commented on GitHub (Jul 6, 2021): I'm trying that now!
Author
Owner

@ghost commented on GitHub (Jul 11, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Jul 11, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@davidanthoff commented on GitHub (Jul 11, 2021):

@DHowett I tried this now, but it does not seem to work. My fragment now is this, and that version ships in the Windows Store as the "Julia" app, so you should be able to try that and see where it doesn't work.

@davidanthoff commented on GitHub (Jul 11, 2021): @DHowett I tried this now, but it does not seem to work. My fragment now is [this](https://github.com/JuliaLang/juliaup/blob/master/msix/Fragments/Julia.json), and that version ships in the Windows Store as the "Julia" app, so you should be able to try that and see where it doesn't work.
Author
Owner

@DHowett commented on GitHub (Jul 11, 2021):

Thanks!

@DHowett commented on GitHub (Jul 11, 2021): Thanks!
Author
Owner

@zadjii-msft commented on GitHub (Jul 20, 2021):

Tentatively sticking on backlog, though we may want to bump this up to a 2.0 priority.

@zadjii-msft commented on GitHub (Jul 20, 2021): Tentatively sticking on backlog, though we may want to bump this up to a 2.0 priority.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14155