Exemple #1
0
 // Implementation of IInstallationCompletedCallback interface...
 public void Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
 {
     // !!! warning this function is invoced from a different thread !!!
     agent.mDispatcher.Invoke(new Action(() => {
         agent.OnInstalationCompleted(installationJob, installationJob.AsyncState);
     }));
 }
Exemple #2
0
        //Installation Complete callback
        void IInstallationCompletedCallback.Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
        {
            try
            {
                var installResult = updateInstaller.EndInstall(installationJob);

                OnInstallationComplete(installResult);
            }
            catch (Exception ex)
            {
                InstallationCompleted?.Invoke(false, false);
                Log.Error("IInstallationCompletedCallback.Invoke", ex.ToString());
            }
        }
        /// <summary>
        /// Used by the windows update api. Do not call this method.
        /// </summary>
        void Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
        {
            bool doCallback = false;

            lock (JobLock)
            {
                if (Job != null && Job.InternalJobObject == installationJob && Job.IsCompleted)
                {
                    StopTimeoutTimer();
                    doCallback = true;
                }
            }
            // calling the callback inside the lock can lead to deadlocks when the callback tries to dispose this object
            if (doCallback)
            {
                _completedCallback(_uInstaller.EndInstall(InstallJob), _uInstaller.Updates);
            }
        }
 public void Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
 {
     WindowsUpdateFrame.installationResult = WindowsUpdateFrame.installer.EndInstall(WindowsUpdateFrame.installationJob);
     WindowsUpdateFrame.progressWindow.Dispatcher.BeginInvoke(new Action(() => WindowsUpdateFrame.textBox1.Clear()));
     SetWinServices.DisableWinService("wuauserv");
     SetWinServices.Disable("wuauserv");
     for (int i = 0; i < WindowsUpdateFrame.installCollection.Count; i++)
     {
         if (WindowsUpdateFrame.installationResult.GetUpdateResult(i).HResult == 0)
         {
             try
             {
                 WindowsUpdateFrame.textBox1.Dispatcher.BeginInvoke(new Action(() => WindowsUpdateFrame.textBox1.AppendText("Installed : " + WindowsUpdateFrame.installCollection[i].Title + "\r\n")));
             }
             catch (Exception e)
             {
                 LogWriter.LogWrite(e.ToString());
             }
         }
         else
         {
             try
             {
                 WindowsUpdateFrame.textBox1.Dispatcher.BeginInvoke(new Action(() => WindowsUpdateFrame.textBox1.AppendText("Failed : " + WindowsUpdateFrame.installCollection[i].Title + "\r\n")));
             }
             catch (Exception e)
             {
                 LogWriter.LogWrite(e.ToString());
             }
         }
     }
     if (WindowsUpdateFrame.installationResult.RebootRequired)
     {
         Process.Start("shutdown", "/r /f /t 30");
     }
     WindowsUpdateFrame.installationJob = null;
     WindowsUpdateFrame.progressWindow.Dispatcher.BeginInvoke(new Action(() => WindowsUpdateFrame.progressWindow.Close()));
 }
Exemple #5
0
 // Implementation of IDownloadCompletedCallback interface...
 public void Invoke(IInstallationJob iInstallationJob, IInstallationCompletedCallbackArgs e)
 {
     form1.iInstallationComplete();
 }
 public void Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs) => _state.Invoke(installationJob, callbackArgs);
 public void Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
 {
     this.CompleteTask();
     ServiceEventSource.Current.InfoMessage("Callback: Installation of Windows Updates is Completed.");
 }
Exemple #8
0
 // Implementation of IDownloadCompletedCallback interface...
 public void Invoke(IInstallationJob iInstallationJob, IInstallationCompletedCallbackArgs e)
 {
     form1.InstallationComplete();
 }
            public void Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
            {
                var clearProgressFlag = false;
                try
                {
                    if (_updateInProgress) return;

                    _updateInProgress = true;
                    clearProgressFlag = true;
                    var wrapper = new UpdateWrapper(installationJob) { TotalPercent = 100, UpdatePercent = 100, CurrentIndex = installationJob.Updates.Count};
                    wrapper.AdjustValues(_lastWrapper);
                    _lastWrapper = wrapper;
                    SetTitle(wrapper);
                    SetText(wrapper);
                }
                catch (Exception e)
                {
                    Log.WarnFormat("An issue occurred while handling an install updates completed event: {0}", e);
                }
                finally
                {
                    if (clearProgressFlag) _updateInProgress = false;
                }
            }
 void IInstallationCompletedCallback.Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
 {
 }
Exemple #11
0
 void IInstallationCompletedCallback.Invoke(IInstallationJob installationJob, IInstallationCompletedCallbackArgs callbackArgs)
 {
 }