private async void OnStartup(object sender, StartupEventArgs e) { _running = true; AppVersion = TccUtils.GetTccVersion(); Log.Config(Path.Combine(BasePath, "logs"), AppVersion); // NLog when? ParseStartupArgs(e.Args.ToList()); if (!File.Exists(Path.Combine(BasePath, SettingsGlobals.SettingsFileName))) { FirstStart = true; } BaseDispatcher = Dispatcher.CurrentDispatcher; BaseDispatcher.Thread.Name = "Main"; RunningDispatchers = new ConcurrentDictionary <int, Dispatcher>(); TccMessageBox.CreateAsync(); if (IsAlreadyRunning() && !Debugger.IsAttached) { if (!ToolboxMode) { TccMessageBox.Show(SR.AnotherInstanceRunning, MessageBoxType.Information); } Current.Shutdown(); return; } if (!Debugger.IsAttached) { AppDomain.CurrentDomain.UnhandledException += GlobalExceptionHandler.HandleGlobalException; } Loading = true; await Setup(); Loading = false; if (FirstStart) { new WelcomeWindow().Show(); } //Tester.Enable(); //Tester.ShowDebugWindow(); }