@@ -24,7 +24,12 @@ namespace KuiperZone.PupNet;
2424/// <summary>
2525/// A base class for package build operations. It defines a working build directory structure under which the
2626/// application is to be published by dotnet, along with other assets such a desktop, AppStream metadata
27- /// and icons. The subclass is to define package specific values and operations by overriding key members.
27+ /// and icons (think 'AppDir' for AppImage, or BUILDROOT for RPM). It is Linux centric, where on Windows unused
28+ /// properties are ignored. The subclass is to define package specific values and operations by overriding key
29+ /// members, and implement the build operation. The build operation is a two-stage process in which
30+ /// <see cref="Create"/> is first called and information present on the console. Note that many of properties of
31+ /// this class are public purely to make them accessible to <see cref="BuildHost"/> class so they can be presented
32+ /// to the user. When the user confirms <see cref="BuildPackage"/> is called to perform the build.
2833/// </summary>
2934public abstract class PackageBuilder
3035{
@@ -59,12 +64,18 @@ public PackageBuilder(ConfigurationReader conf, PackageKind kind)
5964
6065 if ( IconPaths . Count == 0 )
6166 {
62- // Always has some linux icons
67+ // Fallback to embedded icons on Linux
6368 IconPaths = GetShareIconPaths ( Configuration . DesktopTerminal ? DefaultTerminalIcons : DefaultGuiIcons ) ;
6469 }
6570
6671 IconSource = GetSourceIcon ( kind , Configuration . IconFiles ) ;
6772
73+ if ( IconSource == null )
74+ {
75+ // Fallback to embedded icons on Linux
76+ IconSource = GetSourceIcon ( kind , Configuration . DesktopTerminal ? DefaultTerminalIcons : DefaultGuiIcons ) ;
77+ }
78+
6879 // Ignore fact file might not exist if AssertPaths if false (test only)
6980 if ( Configuration . AssertPaths || File . Exists ( Configuration . AppChangeFile ) )
7081 {
@@ -334,13 +345,14 @@ public virtual string? MetaBuildPath
334345 /// <summary>
335346 /// Gets the source path of the "prime" icon, i.e. the single icon considered to be the most generally suitable.
336347 /// On Linux this is the first SVG file encountered, or the largest PNG otherwise. On Windows, it is the first ICO
337- /// file encountered.
348+ /// file encountered. It is a full path to the source icon on build.
338349 /// </summary>
339350 public string ? IconSource { get ; }
340351
341352 /// <summary>
342- /// A sequence of source icon paths (key) and their destinations (value) under <see cref="PackageBuilder.BuildShareIcons"/>.
343- /// Default generic icons are provided if the configuration supplies none. Always empty on Windows.
353+ /// A sequence of source icon paths (key) and their install destinations (value) under
354+ /// <see cref="PackageBuilder.BuildShareIcons"/>. Default generic icons are provided if the configuration supplies
355+ /// none. Always empty on Windows.
344356 /// </summary>
345357 public IReadOnlyDictionary < string , string > IconPaths { get ; }
346358
@@ -655,7 +667,7 @@ private static IReadOnlyCollection<string> GetDefaultIcons(bool terminal)
655667 string name = terminal ? "terminal" : "generic" ;
656668
657669 // Leave windows icon out - leave InnoSetup to assign own
658- // list.Add(Path.Combine(AssemblyDirectory, $"{name}.icon "));
670+ // list.Add(Path.Combine(AssemblyDirectory, $"{name}.ico "));
659671
660672 list . Add ( Path . Combine ( AssemblyDirectory , $ "{ name } .16x16.png") ) ;
661673 list . Add ( Path . Combine ( AssemblyDirectory , $ "{ name } .24x24.png") ) ;
0 commit comments