Beispiel #1
0
        private void UpdateOverHttp(AutomaticUpdate update)
        {
            try
            {
                Directory.CreateDirectory(Path.Combine(SettingsManager.SettingsPath, "update"));
                var path   = Path.Combine(SettingsManager.SettingsPath, "update", "update.exe");
                var client = new WebClient();
                client.DownloadFile(update.HttpLink, path);

                var result = MessageBox.Show("The latest Patchy update is ready to be applied. Would you like to install it now?",
                                             "Update Ready", MessageBoxButton.YesNo, MessageBoxImage.Information);
                if (result == MessageBoxResult.Yes)
                {
                    Process.Start(path);
                }
                else
                {
                    Process.Start("explorer", "\"" + Path.Combine(SettingsManager.SettingsPath, "update") + "\"");
                }
            }
            catch
            {
                MessageBox.Show("Unable to download update. Try again later.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
 public UpdateSummaryWindow(AutomaticUpdate update)
 {
     InitializeComponent();
     DataContext = update;
     Update = update;
 }
 public UpdateSummaryWindow(AutomaticUpdate update)
 {
     InitializeComponent();
     DataContext = update;
     Update      = update;
 }
Beispiel #4
0
        private void UpdateOverHttp(AutomaticUpdate update)
        {
            try
            {
                Directory.CreateDirectory(Path.Combine(SettingsManager.SettingsPath, "update"));
                var path = Path.Combine(SettingsManager.SettingsPath, "update", "update.exe");
                var client = new WebClient();
                client.DownloadFile(update.HttpLink, path);

                var result = MessageBox.Show("The latest Patchy update is ready to be applied. Would you like to install it now?",
                    "Update Ready", MessageBoxButton.YesNo, MessageBoxImage.Information);
                if (result == MessageBoxResult.Yes)
                    Process.Start(path);
                else
                    Process.Start("explorer", "\"" + Path.Combine(SettingsManager.SettingsPath, "update") + "\"");
            }
            catch
            {
                MessageBox.Show("Unable to download update. Try again later.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }