From 53d120d90ec2c113958465f6aada8686c6b01650 Mon Sep 17 00:00:00 2001 From: Aigio Liu Date: Tue, 19 Oct 2021 17:06:38 +0800 Subject: [PATCH] fix Publish --- .editorconfig | 2 +- Directory.Packages.props | 323 +++++++++--------- README.en.md | 3 +- README.md | 3 +- SteamToolsV2+.sln | 35 +- src/AboutAppInfoPopup.cs | 19 +- src/ST.Client.Desktop.Avalonia.App/App.axaml | 6 +- .../App.axaml.cs | 2 +- .../CommandLineTools.cs | 1 - .../NotifyIconHelper.cs | 44 ++- .../PublishProfiles/dev-linux-x64.pubxml | 2 +- .../PublishProfiles/dev-win-x64.pubxml | 2 +- .../PublishProfiles/linux-arm.pubxml | 2 +- .../PublishProfiles/linux-arm64.pubxml | 2 +- .../PublishProfiles/linux-x64.pubxml | 2 +- .../Properties/PublishProfiles/osx-x64.pubxml | 2 +- .../PublishProfiles/win-arm64.pubxml | 2 +- .../Properties/PublishProfiles/win-x64.pubxml | 2 +- .../Implementation/AvaloniaFontManagerImpl.cs | 2 +- .../UI/Styles/Controls/TextBox.xaml | 2 +- .../Application/UI/Styles/Window.xaml | 2 +- .../Pages/About/About_SoftwarePage.axaml | 2 +- .../ArchiSteamFarmPlus/ASF_BotPage.axaml | 2 +- .../UI/Views/Pages/GameListPage.axaml | 2 +- .../GameRelated_BorderlessPage.axaml | 2 +- .../UI/Views/Pages/SteamAccountPage.axaml | 2 +- .../Windows/GameListPage/IdleAppWindow.axaml | 2 +- .../SteamAccountPage/ShareManageWindow.axaml | 2 +- .../ST.Client.Avalonia.csproj | 3 +- .../Properties/AssemblyInfo.OS.cs | 4 + .../ST.Client.Linux.csproj | 2 +- .../Properties/AssemblyInfo.OS.cs | 4 + .../ST.Client.Mac.csproj | 13 +- .../ServiceCollectionExtensions.cs | 2 +- .../Properties/AssemblyInfo.OS.cs | 4 + .../ST.Client.Windows.csproj | 4 +- .../AssemblyInfo.XamlCompilation.cs | 3 + .../ST.Client.XamarinForms.csproj | 26 ++ .../Services/IPlatformService.Linux.cs | 44 +++ .../ArchiSteamFarmServiceImpl.cs | 2 +- .../Services/Mvvm/SteamConnectService.cs | 2 +- src/ST.Client/Services/Mvvm/UserService.cs | 2 +- src/ST.Client/Settings/UISettings.cs | 2 +- .../UI/ViewModels/Base/TabItemViewModel.cs | 2 +- 44 files changed, 376 insertions(+), 217 deletions(-) create mode 100644 src/ST.Client.XamarinForms/Properties/AssemblyInfo.XamlCompilation.cs create mode 100644 src/ST.Client.XamarinForms/ST.Client.XamarinForms.csproj create mode 100644 src/ST.Client/Services/IPlatformService.Linux.cs diff --git a/.editorconfig b/.editorconfig index c56604da7..dc3ca11ee 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,7 +17,7 @@ charset = utf-8 [Makefile] indent_style = tab -[*.{js,json,xaml,axaml,xml,resx,resw,csproj,wapproj,appxmanifest}] +[*.{js,json,xaml,axaml,xml,resx,resw,csproj,wapproj,appxmanifest,.props}] indent_style = space indent_size = 2 diff --git a/Directory.Packages.props b/Directory.Packages.props index 18d226fd1..793d429b2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,163 +1,164 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.en.md b/README.en.md index 9aaf8c309..12c77fbd1 100644 --- a/README.en.md +++ b/README.en.md @@ -15,7 +15,7 @@ [![C# 10.0](https://img.shields.io/badge/c%23-10.0-green.svg?style=flat-square&color=6da86a)](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10) [![Desktop UI](https://img.shields.io/badge/ui@desktop-AvaloniaUI-purple.svg?style=flat-square&color=8c45ab)](https://github.com/AvaloniaUI/Avalonia) -![Mobile UI](https://img.shields.io/badge/ui@mobile-Platform_Native_UI-blue.svg?style=flat-square&color=3498db) +[![Mobile GUI](https://img.shields.io/badge/gui@mobile-Xamarin.Forms-blue.svg?style=flat-square&color=3498db)](https://github.com/xamarin/Xamarin.Forms) [![Official WebSite](https://img.shields.io/badge/website@official-Ant%20Design%20of%20React-blue.svg?style=flat-square&color=61dafb)](https://github.com/ant-design/ant-design) [![BackManage WebSite](https://img.shields.io/badge/website@back_manage-Ant%20Design%20of%20Blazor-purple.svg?style=flat-square&color=512bd4)](https://github.com/ant-design-blazor/ant-design-blazor) @@ -230,6 +230,7 @@ Read what we [milestones](https://github.com/SteamTools-Team/SteamTools/mileston * [AppCenter-XMac](https://github.com/nor0x/AppCenter-XMac) * [MSBuild.Sdk.Extras](https://github.com/novotnyllc/MSBuildSdkExtras) * [Xamarin.Essentials](https://github.com/xamarin/essentials) +* [Xamarin.Forms](https://github.com/xamarin/Xamarin.Forms) * [Open Source Components for Xamarin](https://github.com/xamarin/XamarinComponents) * [Google Play Services / Firebase / ML Kit for Xamarin.Android](https://github.com/xamarin/GooglePlayServicesComponents) * [Picasso](https://github.com/square/picasso) diff --git a/README.md b/README.md index 8ccc187be..795cae99a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ [![C# 10.0](https://img.shields.io/badge/c%23-10.0-brightgreen.svg?style=flat-square&color=6da86a)](https://docs.microsoft.com/zh-cn/dotnet/csharp/whats-new/csharp-10) [![Desktop UI](https://img.shields.io/badge/ui@desktop-AvaloniaUI-purple.svg?style=flat-square&color=8c45ab)](https://github.com/AvaloniaUI/Avalonia) -![Mobile UI](https://img.shields.io/badge/ui@mobile-Platform_Native_UI-blue.svg?style=flat-square&color=3498db) +[![Mobile GUI](https://img.shields.io/badge/gui@mobile-Xamarin.Forms-blue.svg?style=flat-square&color=3498db)](https://github.com/xamarin/Xamarin.Forms) [![Official WebSite](https://img.shields.io/badge/website@official-Ant%20Design%20of%20React-blue.svg?style=flat-square&color=61dafb)](https://github.com/ant-design/ant-design) [![BackManage WebSite](https://img.shields.io/badge/website@back_manage-Ant%20Design%20of%20Blazor-purple.svg?style=flat-square&color=512bd4)](https://github.com/ant-design-blazor/ant-design-blazor) @@ -250,6 +250,7 @@ OS | Version | Architectures | * [AppCenter-XMac](https://github.com/nor0x/AppCenter-XMac) * [MSBuild.Sdk.Extras](https://github.com/novotnyllc/MSBuildSdkExtras) * [Xamarin.Essentials](https://github.com/xamarin/essentials) +* [Xamarin.Forms](https://github.com/xamarin/Xamarin.Forms) * [Open Source Components for Xamarin](https://github.com/xamarin/XamarinComponents) * [Google Play Services / Firebase / ML Kit for Xamarin.Android](https://github.com/xamarin/GooglePlayServicesComponents) * [Picasso](https://github.com/square/picasso) diff --git a/SteamToolsV2+.sln b/SteamToolsV2+.sln index 080cb8ab8..c6e5276cb 100644 --- a/SteamToolsV2+.sln +++ b/SteamToolsV2+.sln @@ -111,9 +111,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI Framework", "UI Framewor EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web API", "Web API", "{4E7DF449-F136-4B90-82CE-D1418CD5123C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.Android", "src\ST.Client.Android\ST.Client.Android.csproj", "{DEF239E4-AC40-4BD8-8D36-5AA6B36AB86B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Client.Android", "src\ST.Client.Android\ST.Client.Android.csproj", "{DEF239E4-AC40-4BD8-8D36-5AA6B36AB86B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.iOS", "src\ST.Client.iOS\ST.Client.iOS.csproj", "{7EE23547-B2AC-409D-991C-1FDAE122657C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Client.iOS", "src\ST.Client.iOS\ST.Client.iOS.csproj", "{7EE23547-B2AC-409D-991C-1FDAE122657C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.XamarinForms", "src\ST.Client.XamarinForms\ST.Client.XamarinForms.csproj", "{3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1267,6 +1269,34 @@ Global {7EE23547-B2AC-409D-991C-1FDAE122657C}.Release|x64.Build.0 = Release|Any CPU {7EE23547-B2AC-409D-991C-1FDAE122657C}.Release|x86.ActiveCfg = Release|Any CPU {7EE23547-B2AC-409D-991C-1FDAE122657C}.Release|x86.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|ARM.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|ARM.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|ARM64.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|iPhone.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|x64.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|x64.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|x86.ActiveCfg = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Debug|x86.Build.0 = Debug|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|Any CPU.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|ARM.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|ARM.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|ARM64.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|ARM64.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|iPhone.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|iPhone.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|x64.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|x64.Build.0 = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|x86.ActiveCfg = Release|Any CPU + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1314,6 +1344,7 @@ Global {4E7DF449-F136-4B90-82CE-D1418CD5123C} = {327FDEE7-C4C8-4AA4-A7B0-8BCE3D75346F} {DEF239E4-AC40-4BD8-8D36-5AA6B36AB86B} = {E50441E8-75F3-406E-9921-30BFC211B5CE} {7EE23547-B2AC-409D-991C-1FDAE122657C} = {E50441E8-75F3-406E-9921-30BFC211B5CE} + {3763D6C4-82B7-4C13-9BB8-886FC1BD83B6} = {8E38AAF2-8C7D-4B0D-AB25-AB37EECB4029} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9313F2B4-10DA-43AA-A481-CAA7571C740C} diff --git a/src/AboutAppInfoPopup.cs b/src/AboutAppInfoPopup.cs index a53d7412c..21080c9c8 100644 --- a/src/AboutAppInfoPopup.cs +++ b/src/AboutAppInfoPopup.cs @@ -21,6 +21,7 @@ namespace System.Application.UI { static class AboutAppInfoPopup { + static readonly IPlatformService platformService = IPlatformService.Instance; static int show_runtime_info_counter; static DateTime show_runtime_info_last_click_time; const int show_runtime_info_counter_max = 5; @@ -57,7 +58,6 @@ namespace System.Application.UI #else if (OperatingSystem2.IsWindows) { - var platformService = IPlatformService.Instance; #pragma warning disable CA1416 // 验证平台兼容性 var productName = platformService.WindowsProductName; var major = Environment.OSVersion.Version.Major; @@ -80,10 +80,25 @@ namespace System.Application.UI b.Append(')'); } } + else if (OperatingSystem2.IsLinux) + { +#pragma warning disable CA1416 // 验证平台兼容性 + var linuxIssue = platformService.LinuxIssue; + if (!string.IsNullOrWhiteSpace(linuxIssue)) + { + b.Append(linuxIssue); + } + else + { + AppendOSName(); + } +#pragma warning restore CA1416 // 验证平台兼容性 + } else { - b.AppendFormat("{0} {1}", DeviceInfo2.OSName, Environment.OSVersion.Version); + AppendOSName(); } + void AppendOSName() => b.AppendFormat("{0} {1}", DeviceInfo2.OSName, Environment.OSVersion.Version); #endif b.AppendLine(); diff --git a/src/ST.Client.Desktop.Avalonia.App/App.axaml b/src/ST.Client.Desktop.Avalonia.App/App.axaml index 520e851c9..2b31a41a0 100644 --- a/src/ST.Client.Desktop.Avalonia.App/App.axaml +++ b/src/ST.Client.Desktop.Avalonia.App/App.axaml @@ -19,8 +19,8 @@ - - + + @@ -30,7 +30,7 @@ GetUserAccentColor="False" UseSegoeUIOnWindows="False"/> - + diff --git a/src/ST.Client.Desktop.Avalonia.App/App.axaml.cs b/src/ST.Client.Desktop.Avalonia.App/App.axaml.cs index a7f77e6dd..aae9294c8 100644 --- a/src/ST.Client.Desktop.Avalonia.App/App.axaml.cs +++ b/src/ST.Client.Desktop.Avalonia.App/App.axaml.cs @@ -125,7 +125,7 @@ namespace System.Application.UI } var uri_0 = new Uri($"avares://Avalonia.Themes.Fluent/Fluent{the}.xaml"); - var uri_1 = new Uri($"avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Styles/Theme{the}.xaml"); + var uri_1 = new Uri($"avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Styles/Theme{the}.xaml"); Styles[0] = new FluentTheme(uri_0) { diff --git a/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs b/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs index e6debf34d..ec0cda6e2 100644 --- a/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs +++ b/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs @@ -3,7 +3,6 @@ using System.Application.Services; using System.CommandLine; using System.CommandLine.Invocation; using System.Threading.Tasks; -using System.Windows; using LogLevel = Microsoft.Extensions.Logging.LogLevel; namespace System.Application.UI diff --git a/src/ST.Client.Desktop.Avalonia.App/NotifyIconHelper.cs b/src/ST.Client.Desktop.Avalonia.App/NotifyIconHelper.cs index 4153c2563..75b01ea50 100644 --- a/src/ST.Client.Desktop.Avalonia.App/NotifyIconHelper.cs +++ b/src/ST.Client.Desktop.Avalonia.App/NotifyIconHelper.cs @@ -20,15 +20,13 @@ using System.IO.Pipes; using System.Linq; using System.Threading; using System.Threading.Tasks; -#if WINDOWS using System.Windows; -#endif using System.Application.UI.ViewModels; using System.Application.UI.Resx; using Avalonia.Controls; -#if LINUX && TRAY_INDEPENDENT_PROGRAM -using GtkApplication = Gtk.Application; -#endif +//#if LINUX && TRAY_INDEPENDENT_PROGRAM +//using GtkApplication = Gtk.Application; +//#endif namespace System.Application.UI { @@ -43,11 +41,11 @@ namespace System.Application.UI string iconPath; if (OperatingSystem2.IsMacOS) { - iconPath = "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/Icon_16.png"; + iconPath = "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/Icon_16.png"; } else { - iconPath = "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/Icon.ico"; + iconPath = "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/Icon.ico"; } return assets.Open(new(iconPath)); } @@ -85,6 +83,29 @@ namespace System.Application.UI else #endif { + if (OperatingSystem2.IsLinux) + { +#pragma warning disable CA1416 // 验证平台兼容性 + if (IPlatformService.Instance.IsDeepin) +#pragma warning restore CA1416 // 验证平台兼容性 + { + // Deepin catch. + // Unhandled exception: System.Reflection.TargetInvocationException: Arg_TargetInvocationException + //---> Tmds.DBus.DBusException: com.deepin.DBus.Error.Unnamed: notifier item has been registered + // at Tmds.DBus.DBusConnection.CallMethodAsync(Message msg, Boolean checkConnected, Boolean checkReplyType) + // at Tmds.DBus.Connection.CallMethodAsync(Message message) + // at Tmds.DBus.CodeGen.DBusObjectProxy.SendMethodReturnReaderAsync(String iface, String member, Nullable`1 inSignature, MessageWriter writer) + // at Avalonia.X11.X11TrayIconImpl.CreateTrayIcon() in /_/src/Avalonia.X11/X11TrayIconImpl.cs:line 85 + // at System.Threading.Tasks.Task.<>c.b__127_0(Object state) + // at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33 + // at Avalonia.Threading.JobRunner.Job.Avalonia.Threading.JobRunner.IJob.Run() in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 166 + // at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37 + // at Avalonia.X11.X11PlatformThreading.CheckSignaled() in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 164 + // at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken) in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 244 + // at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 61 + return null; + } + } NativeMenu menu = new(); menuItemDisposable = InitMenuItems(menu); TrayIcon trayIcon = new() @@ -98,6 +119,10 @@ namespace System.Application.UI { trayIcon, }); + if (OperatingSystem2.IsMacOS) + { + NativeMenu.SetMenu(app, menu); + } } if (menuItemDisposable != null) menuItemDisposable.AddTo(app); return notifyIcon; @@ -138,7 +163,6 @@ namespace System.Application.UI // } #region 仅在非 Windows 上使用平台原生托盘菜单 -#if !WINDOWS || DEBUG static string Exit => AppResources.Exit; static void OnMenuClick(string command) @@ -212,7 +236,7 @@ namespace System.Application.UI //#endif // } static NativeMenuItem? exitMenuItem; - static readonly Dictionary tabItems = new(); + static Dictionary? tabItems; static IDisposable? InitMenuItems(NativeMenu menu) { #if !TRAY_INDEPENDENT_PROGRAM @@ -224,6 +248,7 @@ namespace System.Application.UI let tabItem = x is TabItemViewModel item ? item : null where tabItem != null select tabItem; + tabItems = new(); foreach (var item in query) { var menuItem = new NativeMenuItem @@ -263,7 +288,6 @@ namespace System.Application.UI return null; #endif } -#endif #endregion // #region 仅在 Linux 上使用管道 IPC 调用托盘菜单项点击事件 diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-linux-x64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-linux-x64.pubxml index d47ded77b..d9bc1ee9c 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-linux-x64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-linux-x64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;LINUX; + PUBLISH;LINUX;$(DefineConstants) Debug Any CPU bin\Debug\Publish\linux-x64 diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-win-x64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-win-x64.pubxml index 7e9bf49bb..d6f94c8d6 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-win-x64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/dev-win-x64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;WINDOWS; + PUBLISH;WINDOWS;$(DefineConstants) Debug bin\Debug\Publish\win-x64 FileSystem diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm.pubxml index d77215fd5..7617cc6c3 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;LINUX; + PUBLISH;LINUX;$(DefineConstants) Release ARM bin\Release\Publish\linux-arm diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm64.pubxml index d4022056b..9cb0559e9 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-arm64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;LINUX; + PUBLISH;LINUX;$(DefineConstants) Release ARM64 bin\Release\Publish\linux-arm64 diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-x64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-x64.pubxml index d91ff46d1..4f66f8500 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-x64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/linux-x64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;LINUX; + PUBLISH;LINUX;$(DefineConstants) Release Any CPU bin\Release\Publish\linux-x64 diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/osx-x64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/osx-x64.pubxml index e8c6695eb..456be28af 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/osx-x64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/osx-x64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - MAC;PUBLISH; + MAC;PUBLISH;$(DefineConstants) Release Any CPU bin\Release\Publish\osx-x64 diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-arm64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-arm64.pubxml index 780aa82df..3d4ca50de 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-arm64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-arm64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;WINDOWS; + PUBLISH;WINDOWS;$(DefineConstants) Release ARM64 bin\Release\Publish\win-arm64 diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml index b7f17d9f1..9229b62fa 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;PUBLISH_WIN7;WINDOWS; + PUBLISH;PUBLISH_WIN7;WINDOWS;$(DefineConstants) Release bin\Release\Publish\win-x64 FileSystem diff --git a/src/ST.Client.Desktop.Avalonia/Application/Services/Implementation/AvaloniaFontManagerImpl.cs b/src/ST.Client.Desktop.Avalonia/Application/Services/Implementation/AvaloniaFontManagerImpl.cs index a3fc40690..8f4186e7a 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/Services/Implementation/AvaloniaFontManagerImpl.cs +++ b/src/ST.Client.Desktop.Avalonia/Application/Services/Implementation/AvaloniaFontManagerImpl.cs @@ -16,7 +16,7 @@ namespace System.Application.Services.Implementation readonly IAvaloniaApplication application; readonly Typeface _defaultTypeface = - new("avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/Fonts#WenQuanYi Micro Hei"); + new("avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/Fonts#WenQuanYi Micro Hei"); public static bool UseGdiPlusFirst { get; set; } diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Controls/TextBox.xaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Controls/TextBox.xaml index 4dbfe8143..0fc6b85e7 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Controls/TextBox.xaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Controls/TextBox.xaml @@ -11,7 +11,7 @@ - avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/Fonts#WenQuanYi Micro Hei + avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/Fonts#WenQuanYi Micro Hei 12,0,0,0 diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Window.xaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Window.xaml index 25001ea35..2addb8532 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Window.xaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Styles/Window.xaml @@ -17,7 +17,7 @@ - + diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_SoftwarePage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_SoftwarePage.axaml index a3ed9d61b..6f8c24043 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_SoftwarePage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_SoftwarePage.axaml @@ -186,7 +186,7 @@ diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml index 443c90fd2..0d6a9296c 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml @@ -53,7 +53,7 @@ Source="{Binding AvatarUrl^}"> diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml index fe8a3594b..7f47f858f 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml @@ -441,7 +441,7 @@ DecodeWidth="{ReflectionBinding $parent.Width}" Source="{Binding LibraryLogoStream^}"> - diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml index 70f706766..7bf99ff99 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml @@ -17,7 +17,7 @@ - + diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/SteamAccountPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/SteamAccountPage.axaml index cb11e90ec..95ed745fb 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/SteamAccountPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/SteamAccountPage.axaml @@ -116,7 +116,7 @@ + Source="avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/avater.jpg"> - System.Application.SteamTools.Client.Desktop.Avalonia + System.Application.SteamTools.Client.Avalonia true AVALONIA;$(DefineConstants) @@ -78,6 +78,7 @@ + diff --git a/src/ST.Client.Desktop.Linux/Properties/AssemblyInfo.OS.cs b/src/ST.Client.Desktop.Linux/Properties/AssemblyInfo.OS.cs index 5609a1842..cf6a9f1c1 100644 --- a/src/ST.Client.Desktop.Linux/Properties/AssemblyInfo.OS.cs +++ b/src/ST.Client.Desktop.Linux/Properties/AssemblyInfo.OS.cs @@ -1,3 +1,7 @@ +#if NETSTANDARD +using JustArchiNET.Madness; +#else using System.Runtime.Versioning; +#endif [assembly: SupportedOSPlatform("Linux")] \ No newline at end of file diff --git a/src/ST.Client.Desktop.Linux/ST.Client.Linux.csproj b/src/ST.Client.Desktop.Linux/ST.Client.Linux.csproj index ff504f395..59f55ba65 100644 --- a/src/ST.Client.Desktop.Linux/ST.Client.Linux.csproj +++ b/src/ST.Client.Desktop.Linux/ST.Client.Linux.csproj @@ -3,7 +3,7 @@ net6.0 System.Application - System.Application.SteamTools.Client.Desktop.Linux + System.Application.SteamTools.Client.Linux LINUX;$(DefineConstants) diff --git a/src/ST.Client.Desktop.Mac/Properties/AssemblyInfo.OS.cs b/src/ST.Client.Desktop.Mac/Properties/AssemblyInfo.OS.cs index b069da7f0..d5a22b44c 100644 --- a/src/ST.Client.Desktop.Mac/Properties/AssemblyInfo.OS.cs +++ b/src/ST.Client.Desktop.Mac/Properties/AssemblyInfo.OS.cs @@ -1,3 +1,7 @@ +#if NETSTANDARD +using JustArchiNET.Madness; +#else using System.Runtime.Versioning; +#endif [assembly: SupportedOSPlatform("macOS")] \ No newline at end of file diff --git a/src/ST.Client.Desktop.Mac/ST.Client.Mac.csproj b/src/ST.Client.Desktop.Mac/ST.Client.Mac.csproj index 7ca08e966..81ef78526 100644 --- a/src/ST.Client.Desktop.Mac/ST.Client.Mac.csproj +++ b/src/ST.Client.Desktop.Mac/ST.Client.Mac.csproj @@ -1,12 +1,13 @@ - net6.0;net6.0-macos + + netstandard2.1 System.Application - System.Application.SteamTools.Client.Desktop.Mac + System.Application.SteamTools.Client.Mac - + XAMARIN_MAC;$(DefineConstants) @@ -27,20 +28,20 @@ - + VisualStudioAppCenterSDK.cs - + - + diff --git a/src/ST.Client.Desktop.Mac/ServiceCollectionExtensions.cs b/src/ST.Client.Desktop.Mac/ServiceCollectionExtensions.cs index d4bc6c232..93b8c31a0 100644 --- a/src/ST.Client.Desktop.Mac/ServiceCollectionExtensions.cs +++ b/src/ST.Client.Desktop.Mac/ServiceCollectionExtensions.cs @@ -19,7 +19,7 @@ namespace Microsoft.Extensions.DependencyInjection services.AddSingleton(); services.AddSingleton(s => s.GetRequiredService()); services.AddSingleton(s => s.GetRequiredService()); - if (hasNotifyIcon) services.AddNotifyIcon(); + //if (hasNotifyIcon) services.AddNotifyIcon(); } else { diff --git a/src/ST.Client.Desktop.Windows/Properties/AssemblyInfo.OS.cs b/src/ST.Client.Desktop.Windows/Properties/AssemblyInfo.OS.cs index dec963280..d6fbe1341 100644 --- a/src/ST.Client.Desktop.Windows/Properties/AssemblyInfo.OS.cs +++ b/src/ST.Client.Desktop.Windows/Properties/AssemblyInfo.OS.cs @@ -1,3 +1,7 @@ +#if NETSTANDARD +using JustArchiNET.Madness; +#else using System.Runtime.Versioning; +#endif [assembly: SupportedOSPlatform("Windows")] \ No newline at end of file diff --git a/src/ST.Client.Desktop.Windows/ST.Client.Windows.csproj b/src/ST.Client.Desktop.Windows/ST.Client.Windows.csproj index 0ad731287..cdf9fd545 100644 --- a/src/ST.Client.Desktop.Windows/ST.Client.Windows.csproj +++ b/src/ST.Client.Desktop.Windows/ST.Client.Windows.csproj @@ -1,9 +1,9 @@ - + net6.0 System.Application - System.Application.SteamTools.Client.Desktop.Windows + System.Application.SteamTools.Client.Windows true 10.0.19041.0 WINDOWS;$(DefineConstants) diff --git a/src/ST.Client.XamarinForms/Properties/AssemblyInfo.XamlCompilation.cs b/src/ST.Client.XamarinForms/Properties/AssemblyInfo.XamlCompilation.cs new file mode 100644 index 000000000..c859952e3 --- /dev/null +++ b/src/ST.Client.XamarinForms/Properties/AssemblyInfo.XamlCompilation.cs @@ -0,0 +1,3 @@ +using Xamarin.Forms.Xaml; + +[assembly: XamlCompilation(XamlCompilationOptions.Compile)] \ No newline at end of file diff --git a/src/ST.Client.XamarinForms/ST.Client.XamarinForms.csproj b/src/ST.Client.XamarinForms/ST.Client.XamarinForms.csproj new file mode 100644 index 000000000..23624be79 --- /dev/null +++ b/src/ST.Client.XamarinForms/ST.Client.XamarinForms.csproj @@ -0,0 +1,26 @@ + + + + netstandard2.1 + System.Application + System.Application.SteamTools.Client.XamarinForms + + + + + Properties\AssemblyInfo.cs + + + Properties\AssemblyInfo.Version.cs + + + Properties\InternalsVisibleTo.cs + + + + + + + + + diff --git a/src/ST.Client/Services/IPlatformService.Linux.cs b/src/ST.Client/Services/IPlatformService.Linux.cs new file mode 100644 index 000000000..7c1dae1e1 --- /dev/null +++ b/src/ST.Client/Services/IPlatformService.Linux.cs @@ -0,0 +1,44 @@ +using System.Diagnostics; +#if NETSTANDARD +using JustArchiNET.Madness; +#else +using System.Runtime.Versioning; +#endif +using System.IO; + +namespace System.Application.Services +{ + partial interface IPlatformService + { + static readonly Lazy _LinuxIssue = new(() => + { + if (OperatingSystem2.IsLinux) + { + var filePath = string.Format("{0}etc{0}issue", Path.DirectorySeparatorChar); + if (File.Exists(filePath)) + { + return File.ReadAllText(filePath).TrimEnd(@" \n \l"); + } + } + return string.Empty; + }); + + /// + /// 获取当前 Linux 系统发行版名称 + /// + [SupportedOSPlatform("Linux")] + string LinuxIssue => _LinuxIssue.Value; + + /// + /// 获取当前 Linux 系统发行版是否为 深度操作系统(deepin) + /// + [SupportedOSPlatform("Linux")] + bool IsDeepin => LinuxIssue.Contains("Deepin", StringComparison.OrdinalIgnoreCase); + + /// + /// 获取当前 Linux 系统发行版是否为 Ubuntu + /// + [SupportedOSPlatform("Linux")] + bool IsUbuntu => LinuxIssue.Contains("Ubuntu", StringComparison.OrdinalIgnoreCase); + } +} diff --git a/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs b/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs index 9e15f9f77..292d2ff3b 100644 --- a/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs +++ b/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs @@ -205,7 +205,7 @@ namespace System.Application.Services.Implementation } else { - return "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/avater.jpg"; + return "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/avater.jpg"; } } } diff --git a/src/ST.Client/Services/Mvvm/SteamConnectService.cs b/src/ST.Client/Services/Mvvm/SteamConnectService.cs index c88919e2d..01166092a 100644 --- a/src/ST.Client/Services/Mvvm/SteamConnectService.cs +++ b/src/ST.Client/Services/Mvvm/SteamConnectService.cs @@ -87,7 +87,7 @@ namespace System.Application.Services } } - const string DefaultAvaterPath = "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/avater.jpg"; + const string DefaultAvaterPath = "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/avater.jpg"; object? _AvaterPath = DefaultAvaterPath; public object? AvaterPath { diff --git a/src/ST.Client/Services/Mvvm/UserService.cs b/src/ST.Client/Services/Mvvm/UserService.cs index 5890f2131..8b4a58e71 100644 --- a/src/ST.Client/Services/Mvvm/UserService.cs +++ b/src/ST.Client/Services/Mvvm/UserService.cs @@ -106,7 +106,7 @@ namespace System.Application.Services { if (IApplication.Type == IApplication.AppType.Avalonia) { - return "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/avater_default.png"; + return "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/avater_default.png"; } return string.Empty; } diff --git a/src/ST.Client/Settings/UISettings.cs b/src/ST.Client/Settings/UISettings.cs index 69b763291..6f5956d24 100644 --- a/src/ST.Client/Settings/UISettings.cs +++ b/src/ST.Client/Settings/UISettings.cs @@ -126,7 +126,7 @@ namespace System.Application.Settings /// 背景图片路径 /// public static SerializableProperty BackgroundImagePath { get; } - = GetProperty(defaultValue: "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/Placeholders/0.png", autoSave: true); + = GetProperty(defaultValue: "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/Placeholders/0.png", autoSave: true); /// /// 主题颜色(十六进制字符串) diff --git a/src/ST.Client/UI/ViewModels/Base/TabItemViewModel.cs b/src/ST.Client/UI/ViewModels/Base/TabItemViewModel.cs index 202bd36d4..fc9c7cbb0 100644 --- a/src/ST.Client/UI/ViewModels/Base/TabItemViewModel.cs +++ b/src/ST.Client/UI/ViewModels/Base/TabItemViewModel.cs @@ -20,7 +20,7 @@ namespace System.Application.UI.ViewModels #region Resource Key 图标 - const string DefaultIconPath = "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/Icon/{0}.png"; + const string DefaultIconPath = "avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/Icon/{0}.png"; public virtual string? IconSource => string.Format(DefaultIconPath, IconKey); protected string? _IconKey;