Beispiel #1
0
 private void PerformUpdate(string webPath)
 {
     if (!string.IsNullOrWhiteSpace(webPath))
     {
         Windows.Update u = new Windows.Update(webPath);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Installs the latest update, (make sure to check if an update is available!)
        /// If _AskUser is true, first ask the user if he wants to install it or not
        /// Returns true if the update will be installed, otherwise returns false
        /// </summary>
        public static bool InstallUpdate(bool _AskUser)
        {
            // User don't want to install
            if (_AskUser && MessageBox.Show(Langs.Get("update_request"), Reference.AppName, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            {
                return(false);
            }

            // Fetch update
            JsonUpdate _Update = FetchUpdate();

            // Else install the update

            // Hide splashscreen
            App.Current.MainWindow.Hide();

            // Show update window
            Windows.Update _UpdateWindow = new Windows.Update(_Update.Latest_link);
            _UpdateWindow.ShowDialog();

            // Return
            return(true);
        }
Beispiel #3
0
 private void PerformUpdate(string webPath)
 {
     if (!string.IsNullOrWhiteSpace(webPath))
     {
         Windows.Update u = new Windows.Update(webPath);
     }
 }