protected override void ProcessRecord()
 {
     base.ProcessRecord();
     foreach (WUApiLib.IUpdate Update in UpdateCollection)
     {
         if ((Update.EulaAccepted) && !(Update.InstallationBehavior.CanRequestUserInput))
         {
             updatesToDownload.Add(Update);
             updateDownloader.Updates = updatesToDownload;
             updateDownloader.Download();
         }
     }
 }
예제 #2
0
 protected override void ProcessRecord()
 {
     base.ProcessRecord();
     foreach (WUApiLib.IUpdate thisUpdate in Update)
     {
         if ((thisUpdate.EulaAccepted) && !(thisUpdate.InstallationBehavior.CanRequestUserInput))
         {
             if (!(thisUpdate.IsDownloaded))
             {
                 WriteVerbose("DOWNLOAD : " + thisUpdate.Title);
                 updatesToDownload.Add(thisUpdate);
                 updateDownloader.Updates = updatesToDownload;
                 updateDownloader.Download();
             }
         }
     }
 }
예제 #3
0
 protected override void ProcessRecord()
 {
     base.ProcessRecord();
     foreach (WUApiLib.IUpdate thisUpdate in Update)
     {
         if (thisUpdate.IsDownloaded)
         {
             updatesToInstall.Add(thisUpdate);
             if (thisUpdate.InstallationBehavior.RebootBehavior > 0)
             {
                 RebootRequired = true;
             }
             IUpdateInstaller updateInstaller = Globals.updateSession.CreateUpdateInstaller();
             updateInstaller.Updates = updatesToInstall;
             IInstallationResult installationResult = updateInstaller.Install();
             WriteVerbose(installationResult.HResult.ToString());
         }
     }
 }