diff --git a/DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs b/DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs index 631164f..3c4b5ca 100644 --- a/DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs +++ b/DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs @@ -103,9 +103,9 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration) // 这里不能使用 AppendLine 方法,保持换行使用 \n 字符 stringBuilder .Append("[Desktop Entry]\n") - .Append($"Categories={configuration.DesktopCategories}\n") + .Append($"Categories={configuration.DesktopCategories.TrimEnd(',')};\n") .Append($"Name={configuration.AppName}\n") - .Append($"Keywords={configuration.DesktopKeywords}\n") + .Append($"Keywords={configuration.DesktopKeywords.TrimEnd(',')};\n") .Append($"Comment={configuration.DesktopComment}\n") .Append($"Type={configuration.DesktopType}\n") .Append($"Terminal={configuration.DesktopTerminal.ToString().ToLowerInvariant()}\n") @@ -118,7 +118,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration) if (!string.IsNullOrEmpty(configuration.DesktopKeywordsZhCN)) { - stringBuilder.Append($"Keywords[zh_CN]={configuration.DesktopKeywordsZhCN}\n"); + stringBuilder.Append($"Keywords[zh_CN]={configuration.DesktopKeywordsZhCN.TrimEnd(';')};\n"); } if (!string.IsNullOrEmpty(configuration.DesktopCommentZhCN)) @@ -149,7 +149,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration) if (!string.IsNullOrEmpty(configuration.DesktopMimeType)) { - stringBuilder.Append($"MimeType={configuration.DesktopMimeType}\n"); + stringBuilder.Append($"MimeType={configuration.DesktopMimeType.TrimEnd(';')};\n"); } File.WriteAllText(desktopFile, stringBuilder.ToString(), encoding);