Repairing Products after Patches Advertised Features

Windows Installer supports advertising features to enable users to later install those features on demand. But Windows Installer may advertise features in when a component is removed from a feature through obsolescence or supersedence. This will leave the product in a broken state while reporting that the patch installed successfully.

Silverlight 2.0 Beta (KB949325) and a Debugger patch (KB944899) introduces this problem since they added components that did not exist in future patches. For Visual Studio 2008 SP1 we detect and provide a tool for this issue. But this can happen to any Windows Installer product and has happened.

To repair these products, one would need to identify the features that were advertised by a previous maintenance installation such as patch install, and then reinstall the product passing those features to the ADDLOCAL property which – as its name implies – adds those features locally. To assist with this task, I have written a simple Windows Script file to unadvertise features for a product or products based on a single ProductCode or by enumerating target ProductCodes from a patch package.

The script can be used with cscript.exe or wscript.exe, though optional verbose output will only display to the console.

Download and extract it. Then to repair a product by ProductCode, run the following command:

cscript.exe //nologo Unadvertise.wsf /ProductCode:{80C06CCD-7D07-3DB6-86CD-B57B3F0614D8}

To repair any products a patch may target, run the following command:

cscript.exe //nologo Unadvertise.wsf /Patch:"%TEMP%VS90sp1-KB926601-x86-ENU.msp"

You can also pass additional properties, log verbose output, and see what would happen without actually performing a repair. These options are described on the documentation page.