public Window_UpdateSelf(App.UpdateMessage updateMessage)
 {
     this.updateMessage = updateMessage;
     DataContext        = this;
     NewVersion         = updateMessage.NewstVersion;
     CurrentVersion     = Assembly.GetEntryAssembly().GetName().Version.ToString();
     Message            = updateMessage.Message;
     InitializeComponent();
 }
Пример #2
0
 private void CheckUpdate()
 {
     Log.AddLine("檢查Minecraft updater是否有更新...", Colors.Black);
     var task = Task.Run(() =>
     {
         string filename     = Process.GetCurrentProcess().MainModule.FileName;
         string tempfilename = Path.GetFileNameWithoutExtension(filename) + ".temp" + Path.GetExtension(filename);
         if (File.Exists(tempfilename))
         {
             File.Delete(tempfilename);
         }
         updateMessage = App.CheckUpdate();
         if (updateMessage.HaveUpdate)
         {
             HaveNewVersion = 1;
         }
         else
         {
             HaveNewVersion = 0;
         }
     });
 }