Welcome to MSDN Blogs Sign in | Join | Help

Source Resolution during Patch Uninstall

There are a number of guidelines to prevent requiring source media for patch installation. These guidelines can also help prevent requiring source media during patch uninstall, but there are a number of caveats.

Recall from Rebuilding the Installer Cache that the baseline cache contains files that were replaced. But files that get replaced don't always get copied to the baseline cache. When uninstalling the patch, since these files aren't in the baseline cache, the original source media is required. If the source media isn't available in the registered cache locations, a prompt during UI installs will occur or the installation will fail during silent installations.

A file may not be cached in the baseline for a number of reasons:

  1. A file was updated in the patch (the Attributes column in the File table included the msidbFileAttributesPatchAdded (0x1000) attributed) but the file on disk was identical and unmodified. When the patch is uninstalled, Windows Installer will attempt to reinstall the original file because the patch file is being removed.
    1. This could be caused by another patch – perhaps even for another product – that already updated the file.
    2. This could also be caused by a file being included in the patch that is not actually updated from the target from which the patch was built.
  2. Native assemblies are installed using the MsiAssembly and MsiAssemblyName tables. Windows Installer delegations to fusion (fusion.dll for managed assemblies; sxs.dll for native assemblies) to install files, but fusion cannot report back the manifest and catalog locations. Sine these locations are unknown to Windows Installer, it cannot cache these files in the baseline.

There's quite a bit of information available in a verbose installation log, but for specific reasons why a file isn't cached in the baseline cache you must enable debug logging as well, by passing the "x" parameter to the logging command switch for Windows Installer 3.0 and newer, such as in the following example:

msiexec.exe /i {BDEFF59A-9751-4023-BEDB-F6501B97ACA2} /L*vx patch.log PATCH=example.msp

You can also set the debugging system policy in addition to the logging system policy.

After the final patch application order, you will find that file information is saved for files that will be replaced. During CostInitialize the baseline caches and files are enumerated, and during InstallFinalize (or whenever deferred actions are run for InstallFiles and related actions) you'll find operations to perform the actual baseline caching. Each will precede the file copy operations, so if there is no baseline caching operation logged for a file before a file copy operation, the file has not been cached for that product and uninstalling the patch must resolve source, which you'll see logged starting with "Resolving Source" in a verbose log.

Published Friday, December 08, 2006 11:46 PM by Heath Stewart
Filed under: ,

Comments

Sunday, December 10, 2006 10:58 PM by CK

# re: Source Resolution during Patch Uninstall

Heath,

    With regard to the reasons in 1) listed above, is there a way to force Windows installer to cache the file always?

thanks.

Monday, December 11, 2006 7:34 PM by Heath Stewart

# re: Source Resolution during Patch Uninstall

Not without eliminating shared components, which also implies those files in each product need to go to different install locations since the baseline cache is per-product, based on the ProductCode.

Friday, December 22, 2006 3:19 PM by Teoman Soygul

# re: Source Resolution during Patch Uninstall

Heath,

 I couldn't find the answer for this in msn forums so asking you:

- Say that we have VS2005 + SP1 installed on all systems + 1 hotfix that was released after sp1. For a "Repair" event, will Windows Installer need all three of these files -or- are they all cached properly so that no installation media will be needed?

Saturday, December 23, 2006 3:39 AM by Heath Stewart

# re: Source Resolution during Patch Uninstall

Teoman, MSPs are always cached in whole as described in http://blogs.msdn.com/heaths/archive/2005/11/29/498018.aspx. When you repair a product, if any patches are installed and active (not superseded) they are brought into view, transforming the original product.

If files are missing that were not in the patch during a repair, source may be required. Any files that are patched will be obtained from the cached MSPs.

Friday, December 29, 2006 5:23 AM by Heath Stewart's Blog

# The Visual Studio 2005 Service Pack 1 Installation Experience

Visual Studio 2005 Service Pack 1 can take a long time to install and may apply to multiple products

Wednesday, January 17, 2007 1:14 PM by Heath Stewart's Blog

# The Patch Cache and Freeing Space

When you install a patch using Windows Installer, the .msp file is cached in the %WINDIR%\Installer directory.

Monday, August 27, 2007 5:14 PM by Heath Stewart's Blog

# What's New in Windows Installer 4.5: Overview

The What's New section of the Windows Installer 4.5 CHM available in the downloads section of the Windows

Thursday, October 25, 2007 8:37 PM by Heath Stewart's Blog

# ResolveSource Requires Source

It might be tempting to schedule the ResolveSource action , but ResolveSource actually requires that

Thursday, October 25, 2007 8:49 PM by Noticias externas

# ResolveSource Requires Source

It might be tempting to schedule the ResolveSource action , but ResolveSource actually requires that

Monday, February 18, 2008 4:40 PM by Heath Stewart's Blog

# Adding New Components to Existing Features Installs the Feature Tree

As Developer Division starts to ship patches for the Visual Studio 2008 , some users are being prompted

Friday, July 25, 2008 2:20 AM by Heath Stewart's Blog

# Why Windows Installer May Require so much Disk Space

Windows Installer is an engine for performing transactional installations. When installing a product

Monday, August 11, 2008 3:49 PM by Heath Stewart's Blog

# VS 2008 SP1 Beta must be removed prior to installing the release of VS 2008 SP1

When I announced that Visual Studio 2008 SP1 RTM will install over SP1 beta , we were on track to make

New Comments to this post are disabled
 
Page view tracker