using Avalonia; using fis.Upgrader.Helpers; using fis.Upgrader.Managers; using System; using System.Globalization; using System.IO; using System.Text; using System.Threading.Tasks; namespace fis.Upgrader { internal class Program { // Initialization code. Don't use any Avalonia, third-party APIs or any // SynchronizationContext-reliant code before AppMain is called: things aren't initialized // yet and stuff might break. [STAThread] public static void Main(string[] args) { var storagePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AppStorage"); var languageConfig = Path.Combine(storagePath, "configed_language_local.conf"); string? languageCode; if (!File.Exists(languageConfig)) { languageCode = CultureInfo.CurrentUICulture.Name; } else { string configText = File.ReadAllText(languageConfig, Encoding.UTF8); languageCode = configText?.Trim(); } TranslationHelper.CurrentLanguageCode = languageCode!; Task.Run(() => { UpgradeManager.Instance.RunFullUpgrade(); }); BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); } // Avalonia configuration, don't remove; also used by visual designer. public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() .UsePlatformDetect() .LogToTrace(); } }