Example #1
0
 private void DownloadJob()
 {
     try { Downloader.DownloadMod(ARKModID, SpacewarModID, ref ARKModDetails, ref SpacewarModDetails); }
     catch (Exception Exception)
     {
         Downloader.ReleaseLock();
         if (Exception is AggregateException)
         {
             Exception = Exception.InnerException;
         }
         if (Exception is ValidatorException)
         {
             Dispatcher.Invoke(() =>
             {
                 SetStatus(string.Format(LocString(LocCode.ValidatorExc), Exception.Message), DarkRed);
                 FinishHandler();
                 DeletePath($@"{Game.Path}\ShooterGame\Content\Mods\{SpacewarModID}");
             });
         }
         else
         {
             WriteAllText($@"{AppDataFolder}\LastCrash.txt", $"{Exception.Message}\n{Exception.StackTrace}");
             Dispatcher.Invoke(() =>
             {
                 new CrashWindow(Exception).ShowDialog();
                 Current.Shutdown();
             });
         }
         return;
     }
 }