Search This Blog

Thursday, 16 June 2016

WSUS Offline and Offline Servicing - How to download Windows Updates from your WSUS, not MS and apply them to your images

WSUS Offline

Many thanks to Torsten Wittrock and all the WSUS offline contributors for this FOSS package of scripts and tools. The open-source community can astound you with quality and flexibility in fields where commercial products leave a gap and this is a fine example.

Keeping offline Windows OS computers fully updated. Simple as:
1: Fire up the update generator on a PC with an internet connection
2: Select the updates needed for the offline computer and download
3: Move the folder to the offline computer by any storage medium
4: Fire up the update installer

The idea

If you know about how the Windows installation process works, you'll know that you can actually create customised installs of windows on various mediums, pre-loaded with drivers, updates, applications and enabled features accommodating some quite abstract deployment scenarios. When you're reinstalling PCs frequently, it's quite time consuming to 'clean' install from disk, then update, then add the extras, so the time invested in customising an image quickly returns several times over.

Strangely, even the customisation process has various methods and paths that do not necessarily have to be taken but can provide some advantages. You can take a PC, install it with all the business you need, generalise the Windows installation and capture an image of it to use for installation purposes. You can also use 'offline servicing' to take the install image from a Windows disc and apply your configuration options to it instead and I prefer this method for a few reasons. Firstly, I don't actually have to install the OS which would either require hardware or messing with VMs which takes space and CPU power, so more time consuming and the second is the process can be fairly automated so many bonuses to be had there as well.

The Problem

You can get most of the Windows versions ISOs for free which are easily mounted into a virtual CD drive or extracted to give you the installation files. These can be modified as described, but where do you get these packages? Drivers can usually be found on the manufacturer's web pages and discs, applications from their various sites, but what about the windows updates? Offline servicing is a helping hand, no doubt, but not a 'better' option, just a different method and at first, it would look as though an installation into a VM would be simpler, but this is where WSUS Offline comes in. You can download the updates, then apply them to the image using DISM (Great article, take note of updates to avoid).

Cool! But something's not working for me...

Excellent, I can use WSUS Offline to get all the updates for the various versions of Windows. Rock solid, and strangely enough, because I have VMs and a WSUS server, I wanted to see if I could get the updates from my server. I set the tools to point to my server, and it started downloading from Microsoft. This is the default behaviour, but I wanted my already vetted updates only, not all of them.

The solution

I added the line wsusonly=Enabled to the [Miscellaneous] section of the UpdateGenerator.ini file, but now the downloads kept failing because the download path was incorrect. My WSUS updates folder is called \WSUSContent\, but the path created by the tools pointed at \Content\. I knew the script to set this value had to be hidden somewhere in the folder so using a simple windows file content search, I found the line in the \wsusoffline\cmd\CreateDownloadTable.vbs file with the assignment: Private Const strWSUSRootFolder = "Content/". Change that to "WSUSContent/" and we're in business! Meanwhile, the answer was here, in German. :P

If you plan on creating customised installation media often, it may be possible to completely automate the tasks with scripts, but at least to myself, I have proved that it is possible to take a Windows installation image and add drivers, applications packages, enabled features and updates all with offline servicing.