MaxPatchCacheSize and Windows 7

So I was building a Windows 7 virtual machine, so I could play “Gardens of Time” as GoT doesn’t work on my Windows 2008 R2 box …, and I went looking for MaxPatchCacheSize setting in the registry.

I didn’t have access to the internet* and I wanted to set the setting so I could save space on my VM.  But the setting isn’t in the registry by default!

So as it’s a “policies” registry setting, I was able to find it in the Local Group Policy Editor (gpedit.msc):
Baseline file cache maximum size

The policy is called “Baseline file cache size”:

This policy controls the percentage of disk space available to the Windows Installer baseline file cache.

The Windows Installer uses the baseline file cache to save baseline files modified by binary delta difference updates. The cache is used to retrieve the baseline file for future updates. The cache eliminates user prompts for source media when new updates are applied.

If you enable this policy setting you can modify the maximum size of the Windows Installer baseline file cache.

If you set the baseline cache size to 0, the Windows Installer will stop populating the baseline cache for new updates. The existing cached files will remain on disk and will be deleted when the product is removed.

If you set the baseline cache to 100, the Windows Installer will use available free space for the baseline file cache.

If you disable this policy setting or if it is not configured the Windows Installer will uses a default value of 10 percent for the baseline file cache maximum size.

Changing the setting in the Local Group Policy Editor created the HKLM\Software\Policies\Microsoft\Windows\Installer\MaxPatchCacheSize key.

* – if I did have access to the internet, I would have remembered that I could have done this with a simple reg.exe command:
reg add HKLM\Software\Policies\Microsoft\Windows\Installer /v MaxPatchCacheSize /t REG_DWORD /d 0 /f

I wrote about that here.

Saving space in a VM with MaxPatchCacheSize

I first read about MaxPatchCacheSize, and how to use it to save space in Virtual Machines, over at Jeremy Jameson’s blog.

From the Microsoft MSDN Library entry for MaxPatchCacheSize:

“The value of the MaxPatchCacheSize policy is the maximum percentage of disk space that the installer can use for the cache of old files. For example, a value of 20 specifies no more than 20% be used. If the total size of the cache reaches the specified percentage of disk space, no additional files are saved to the cache. The policy does not affect files that have already been saved.

If the value of the MaxPatchCacheSize policy is set to 0, no additional files are saved.”

But how much can it save really??? Well there is only one way to know how much it will save, and that is to test it, and measure the savings.

The Tests.
1. Office 2010 upgrade
2.Windows XP Windows Update.

I set the MaxPatchCacheSize entry to 0 by doing the following on a command line:
reg add HKLM\Software\Policies\Microsoft\Windows\Installer /v MaxPatchCacheSize /t REG_DWORD /d 0 /f

I setup a Virtual Machine with no MaxPatchCacheSize, ran the test, then reset the PC back to it’s unpatched state (aka reverted a snapshot).  Then ran the test again with MaxPatchCacheSize set to 0.

Office 2010 Upgrade
I upgraded Office 2007 to Office 2010, by accepting the default Upgrade option.
The result was disappointing, only 20 megabytes was saved.
So that’s a FAIL for MaxPatchCacheSize.

Windows XP Windows Update
I took a Windows XP SP3 PC, with no additional post SP3 security patches, and visited WindowsUpdate.  90 minutes later, I had a fully patched machine.
And a far better result for MaxPatchCacheSize.  448 megabytes.
On a 16GB hard disk, 448 megabytes is a worthwhile saving.
That’s a SUCCESS for MaxPatchCacheSize.

So in conclusion.
MaxPatchCacheSize is useful for Windows Installer based patches.  Not so much for a product upgrade such as Office 2010.

Bookmark and Share

What? WindowsUpdate doesn’t work with a non-activated Windows XP?

And I only just realised it now. *
Windows Activation Required Now I’m not going to complain about Microsoft.  If you have a valid license key, you should activate it. 

But I don’t want to activate Windows as I’m just doing some tests, part of the Undelete series of posts.  And before someone says “Dude, you should activate it.”.  Well, in future,  I don’t want to go though the re-activation hell process, with some worker based offshore.

Automatic updatesBut Microsoft does offer a work-around, Automatic Updates, but I just don’t care for it.

Perhaps the fact that AU has rebooted my PC in a middle of a 4GB download has soured my experience.

So what to do instead?  Not patch?  No, you have to patch, it’s the prudent thing to do.

No, instead, I grabbed a copy of AutoPatcher.  I wrote about AutoPatcher here.  To recap, I like it because it works, and it’s free.  And 66 updates later, Windows XP will be a little bit more secure.
AutoPatcher - showing only 66 updates to apply.

* most of the Windows XP installs I work with have a Corporate license which is already activated. (a VLK.  In Microsoft Vista/Windows 7 licensing speak, it’s a MAK type key)

Bookmark and Share

Windows Update website – Error 0x800C0002

Internet Explorer 5 About screen Had this error while trying to update a Windows 2000 SP4 test box.  As it’s a test box, it has the bare minimum installed.

Microsoft’s solution?

  • clean the Internet Explorer cache
  • Delete some files in the WindowsUpdate directory
  • Delete some DLL’s.

None of those worked.

The actual solution which worked for me? Install Internet Explorer 6.

Other things I could have tried?  Autopatcher, which I wrote about here. Except that Autopatcher no longer supports Windows 2000.  🙁
Or apply the patches one by one, after running an MBSA scan? Maybe.

IE5?  Well I did say it was a test box.

Bookmark and Share

Windows Update website – Error 0x80240025

on a Windows XP PC.  As I wrote in Windows Update: Network policy settings prevent you from using this website …, you’d often see a Windows Update error when your Corporate IT types block access on purpose.

But wait!  I’m my Corporate IT type!  What did I do to break it for myself???

Well somewhere along the line, I configured a system group policy to block access to Windows Update, and I ended up tripping over my own trap.

The solution/work-around was to delete the
HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate - "DisableWindowsUpdate" key.

Once I did that, the Windows Update site worked with no errors.

You can download a .reg file which does that, and the other two registry keys I mentioned in the earlier article, right here.

Bookmark and Share

VBscript to uninstall a Microsoft security patch

This is a small script I wrote many years ago to uninstall security patches.  I customise it when I need it.

In this example, I’ve customised it for MS09-032, but the principles apply to most patches.

Note that I don’t check for admin rights, I’m assuming that I’ll be using a desktop software deployment tool to run it on the user’s desktop.

' VBscript to roll back a security patch, in this case MS09-032.
‘ Dale Robinson – 2006 –> 2009

Option Explicit
On Error Resume Next

Dim bUninstallFileExists, OSSystemRoot, objWSHShell, objEnv, sMS09032Installed, sPatchCmd,sUninstallExe

Set objWSHShell = WScript.CreateObject("WScript.Shell")
Set objEnv = objWSHShell.Environment("Process")

' MS09-032 sets this registry key if it's installed.

Continue reading

“Windows Update: Network policy settings prevent you

… from using this website to get updates for your computer.
If you believe you have received this message in error, please contact your system administrator.”

Network policy settings prevent you from using this website

This often happens on Corporate networks because your Corporate IT guys don’t want you to apply updates which they have not been approved.
As updates can break things.  (see tomorrow’s post for an example of a patch which breaks things).

But what if you’re the Corporate IT guy and you want to apply patches for testing?

You need to change two registry keys:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate
set DisableWindowsUpdateAccess to 0

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
set NoWindowsUpdate to 0

You can download a .reg file which does that here.

This post brought you by my frustration in having to find these registry keys every month, and my co-worker Ant, who recently asked “how do I disable the policy?”

Update: and if it still doesn’t work, have a read of Windows Update website – Error 0x80240025.

Bookmark and Share