@@ -65,15 +65,18 @@ public PackageBuilder(ConfigurationReader conf, PackageKind kind)
6565 if ( IconPaths . Count == 0 )
6666 {
6767 // Fallback to embedded icons on Linux
68+ // Should always empty on non-linux systems
6869 IconPaths = GetShareIconPaths ( Configuration . DesktopTerminal ? DefaultTerminalIcons : DefaultGuiIcons ) ;
6970 }
7071
71- IconSource = GetSourceIcon ( kind , Configuration . IconFiles ) ;
72+ // Should be ico on Windows, or SVG or PNG on linux
73+ PrimaryIcon = GetSourceIcon ( kind , Configuration . IconFiles ) ;
7274
73- if ( IconSource == null )
75+ if ( PrimaryIcon == null )
7476 {
77+ // It can be null on Windows.
7578 // Fallback to embedded icons on Linux
76- IconSource = GetSourceIcon ( kind , Configuration . DesktopTerminal ? DefaultTerminalIcons : DefaultGuiIcons ) ;
79+ PrimaryIcon = GetSourceIcon ( kind , Configuration . DesktopTerminal ? DefaultTerminalIcons : DefaultGuiIcons ) ;
7780 }
7881
7982 // Ignore fact file might not exist if AssertPaths if false (test only)
@@ -347,7 +350,7 @@ public virtual string? MetaBuildPath
347350 /// On Linux this is the first SVG file encountered, or the largest PNG otherwise. On Windows, it is the first ICO
348351 /// file encountered. It is a full path to the source icon on build.
349352 /// </summary>
350- public string ? IconSource { get ; }
353+ public string ? PrimaryIcon { get ; }
351354
352355 /// <summary>
353356 /// A sequence of source icon paths (key) and their install destinations (value) under
@@ -729,19 +732,24 @@ private static int GetStandardPngSize(string filename)
729732 return item ;
730733 }
731734
732- if ( ! kind . TargetsWindows ( ) && ext == ".svg" )
735+ if ( ! kind . TargetsWindows ( ) )
733736 {
734- // Or this for non-windows
735- return item ;
736- }
737+ // For non-windows
738+ if ( ext == ".svg" )
739+ {
740+ // Preferred
741+ return item ;
742+ }
737743
738- // Get biggest PNG
739- int size = GetStandardPngSize ( item ) ;
744+ // Or biggest PNG
745+ int size = GetStandardPngSize ( item ) ;
746+
747+ if ( size > max )
748+ {
749+ max = size ;
750+ rslt = item ;
751+ }
740752
741- if ( size > max )
742- {
743- max = size ;
744- rslt = item ;
745753 }
746754 }
747755
0 commit comments