// Token: 0x06000062 RID: 98 RVA: 0x00002F04 File Offset: 0x00002F04
 protected override void OnStartup(StartupEventArgs e)
 {
     if (this.HasCriticalException)
     {
         this.HandleCriticalError(this.criticalException);
         return;
     }
     base.OnStartup(e);
     try
     {
         bool      flag             = true;
         Process[] processesByName  = Process.GetProcessesByName("r5Apex");
         IntPtr    value            = WinAPI.FindWindow("CryENGINE", "Warface");
         Process[] processesByName2 = Process.GetProcessesByName("Game");
         Process[] processesByName3 = Process.GetProcessesByName("GameCenter");
         if (processesByName2.Length != 0 || value != IntPtr.Zero || processesByName.Length != 0)
         {
             flag = false;
         }
         if (processesByName3.Length != 0)
         {
             Protect.KillProcesses(new string[]
             {
                 "GameCenter"
             });
         }
         if (flag)
         {
             if (!util.IsConnectedToInternet())
             {
                 base.Dispatcher.Invoke(delegate()
                 {
                     CustomMessageBox.Show(CLanguage.GetTranslateText("errorconnect"), CLanguage.GetTranslateText("err_header_msg"), MessageBoxButton.OK, false);
                 });
                 flag = false;
             }
             if (!util.IsRunAsAdmin())
             {
                 Process.Start(new ProcessStartInfo(Process.GetCurrentProcess().MainModule.FileName)
                 {
                     Verb = "runas"
                 });
                 flag = false;
             }
         }
         if (flag)
         {
             this.appMutex = new INFMutex(new Func <bool>(this.InitializeProgram));
             flag          = this.appMutex.InitializeProgramOrSendMessage();
         }
         if (!flag)
         {
             this.Cleanup();
             App.AppExit();
         }
     }
     catch (Exception)
     {
         this.Cleanup();
         App.AppExit();
     }
 }