bklockwood / PSWU

PowerShell Windows Update. CLI/scripted windows updates!
MIT License
24 stars 2 forks source link

Win7: patch Windows Update before applying any other updates #53

Open bklockwood opened 8 years ago

bklockwood commented 8 years ago

In episode 464 of the Runas Radio podcast, Clint Huffman talks about how he discovered a performance bug in Windows Update. He took this to the Windows team who designed a patch for it. He is clear in the podcast, saying it is a Win7 bug only. I believe the bug is in WUA UpdateSearcher, causing the 'search for updates' to take a really long time: 20-200 minutes (depending on various factors). I've already shown that the issue was not a network speed or download problem.

So I would like to update or patch WUA before doing even the first round of updates on a fresh-installed Win7 system. The could shave literal hours off of the initial search for updates.

Unfortunately the show does not provide clarity about which specific patch resolves the issue. The show host brassily says it must be this rollup, but I suspect he is wrong.

Some links I have fruitlessly chased:


RESULT: KB3138612 does vastly speed up the first run of WU (from >89 minutes to <5 minutes). But this doesn't speed up the initial patch installation on a new Win7 system ... because installing KB3138612 invokes all of WU anyway, which takes 89 minutes! See below for data. So I am reluctantly closing this issue. I see no clean and swift way to update WUA before use. So will have to let it experience the bug until it updates itself.

bklockwood commented 8 years ago

I think the target update may be KB3050265. However, Microsoft Update Catalog says it has been replaced/superseded by all of these:

Update for Windows 7 for x64-based Systems (KB3065987) Update for Windows 7 for x64-based Systems (KB3075851) Update for Windows 7 for x64-based Systems (KB3083324) Update for Windows 7 for x64-based Systems (KB3083710) Update for Windows 7 for x64-based Systems (KB3102810) Update for Windows 7 for x64-based Systems (KB3112343) Update for Windows 7 for x64-based Systems (KB3135445) Update for Windows 7 for x64-based Systems (KB3138612)

I found only the last of these (KB3138612) on a Win7 system that had been through 1 round of updates. So, will experiment with downloading it from the Catalog and manually applying.

bklockwood commented 8 years ago

Double clicking on the downloaded file results in seeing the following dialog for a long time:

image

I didn't run a timer but it's easily been like this for 45 minutes or more. KB934307 describes WUSA as using the Windows Update Agent API. So apparently this may take hours?

bklockwood commented 8 years ago

Rebooted to cancel the above. Trying DISM instead:

PS > dism /online /add-package /packagepath:C:\users\bob\Downloads\AMD64-all-windows6.1-kb3138612-x64_f7b1de8ea7cf8faf57b0138c4068d2e899e2b266.msu

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Image Version: 6.1.7600.16385

Processing 1 of 1 - An error occurred - C:\users\bob\Downloads\AMD64-all-windows6.1-kb3138612-x64_f7b1de8ea7cf8faf57b0138c4068d2e899e2b266.msu Error: 0x80070032

Error: 50

The request is not supported.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
PS>

Relevant dism.log entry is:

DISM Package Manager: PID=2128 DISM does not support installing MSU files online. - CMsuPackage::Install(hr:0x80070032)

bklockwood commented 8 years ago

Trying WUSA again from prompt:

PS> Measure-Command {wusa .\AMD64-all-windows6.1-kb3138612-x64_f7b1de8ea7cf8faf57b0138c4068d2e899e2b266.msu /log}

Silly. measure-command returned instantly but wusa threw up its dialog: image

Still, this started around 9:25PM. Will wait to see how long it takes.

Argh. Ended at 10:54 (89 minutes) with: image

This populated WU with 219 Important updates and 44 optional. 3138612 is one of the important. So I deselected all others and installed it. This took less than two minutes, not including the required restart.

After the restart, I started another 'check for updates' via the gui WU interface. The search took less than 5 minutes.

bklockwood commented 8 years ago

Trying the standalone installer at KB949104. I had previously tested this informally and found it speeded things up. Today it's doing terrible.

The installer is for WUA version 7.6.7600.256 ... older than the 7.6.7600.320 found on a new-installed Wn7 SP1 (x64). So running it leaves the system at 7.6.7600.320 (though the installer does not notify of this, it seems to complete successfully). Running Get-UpdateList after installing took 44 minutes.

bklockwood commented 8 years ago

Trying KB2775511, started at 2:34. Again mesaure-command fails and the searching begins:

image

I couldn't sit and watch. I know this is from more than 34, but less than 86 minutes later (at 3:50):

image

Clicking 'yes' went to

image

(this is a waste of time)