예제 #1
0
        static void SilentInstall()
        {
            var data = KivaUpdates.DownloadAssetData(KivaUpdates.DataAssetName);

            KivaUpdates.InstallFromStream(data);
            data.Close();
            FinalizeInstall();
        }
예제 #2
0
        static void UpdateFromPackage(string path)
        {
            if (!File.Exists(path))
            {
                if (!Silent)
                {
                    MessageBox.Show("Could not install update, update package file missing", "Update failed");
                }
                return;
            }
            var f = File.OpenRead(path);

            KivaUpdates.KillAllKivas();
            KivaUpdates.InstallFromStream(f);
            f.Close();
            File.Delete(path);
        }
예제 #3
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     Task.Run(() =>
     {
         try
         {
             var data = KivaUpdates.DownloadAssetData(KivaUpdates.DataAssetName);
             Dispatcher.Invoke(() => progressText.Content = "Installing...");
             KivaUpdates.InstallFromStream(data);
             data.Close();
             Program.FinalizeInstall();
             Dispatcher.Invoke(() => Close());
         }
         catch (Exception ex)
         {
             exception = ex;
             Dispatcher.Invoke(() => Close());
         }
     });
 }