Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…s.DotNETBuildSDK into t/lindexi/TargetFramework
  • Loading branch information
lindexi committed Apr 16, 2024
2 parents 8cae0a7 + 75426a6 commit d4c222e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions DebUOS/Packaging.DebUOS.NuGet/Build/package.targets
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
<DebUOSPackingWriteArgLine Include="$([MSBuild]::Escape($(DesktopCommentZhCN)))"/>
<DebUOSPackingWriteArgLine Include=">"/>

<DebUOSPackingWriteArgLine Include=">"/>
<DebUOSPackingWriteArgLine Include="DesktopNoDisplay" Condition="$(DesktopNoDisplay)!=''"/>
<DebUOSPackingWriteArgLine Include="$([MSBuild]::Escape($(DesktopNoDisplay)))"/>
<DebUOSPackingWriteArgLine Include=">"/>

<DebUOSPackingWriteArgLine Include=">"/>
<DebUOSPackingWriteArgLine Include="DesktopExec" Condition="$(DesktopExec)!=''"/>
<DebUOSPackingWriteArgLine Include="$(DesktopExec)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ public string? DesktopCommentZhCN
get => GetString();
}

/// <summary>
/// 配置放入到 opt\apps\${AppId}\entries\applications\${AppId}.desktop 文件的 NoDisplay 属性,如果设置为 true 则表示当前的应用不放在开始菜单里面,即在开始菜单隐藏应用。一般用于一些不想让用户直接碰到的,直接运行的应用
/// </summary>
public bool? DesktopNoDisplay
{
set => SetValue(value);
get => GetBoolean();
}

/// <summary>
/// 配置放入到 opt\apps\${AppId}\entries\applications\${AppId}.desktop 文件的 Exec 属性,作为程序的启动命令,可不填,且推荐不填,除非有特殊需求。默认为 /opt/apps/${AppId}/files/bin/${AssemblyName} 的值
/// </summary>
Expand Down
10 changes: 8 additions & 2 deletions DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System.Globalization;
using System.IO;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -108,7 +109,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
.Append($"Keywords={configuration.DesktopKeywords.TrimEnd(',')};\n")
.Append($"Comment={configuration.DesktopComment}\n")
.Append($"Type={configuration.DesktopType}\n")
.Append($"Terminal={configuration.DesktopTerminal.ToString().ToLowerInvariant()}\n")
.Append($"Terminal={configuration.DesktopTerminal.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()}\n")
.Append($"StartupNotify={configuration.DesktopStartupNotify.ToString().ToLowerInvariant()}\n");

if (!string.IsNullOrEmpty(configuration.AppNameZhCN))
Expand All @@ -126,6 +127,11 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
stringBuilder.Append($"Comment[zh_CN]={configuration.DesktopCommentZhCN}\n");
}

if (configuration.DesktopNoDisplay is not null)
{
stringBuilder.Append($"NoDisplay={configuration.DesktopNoDisplay.Value.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()}\n");
}

if (!string.IsNullOrEmpty(configuration.DesktopExec))
{
stringBuilder.Append($"Exec={configuration.DesktopExec}\n");
Expand Down

0 comments on commit d4c222e

Please sign in to comment.