{"id":1863,"date":"2006-11-30T14:47:29","date_gmt":"2006-11-30T14:47:29","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2006\/11\/30\/rebuilding-the-installer-cache\/"},"modified":"2006-11-30T14:47:29","modified_gmt":"2006-11-30T14:47:29","slug":"rebuilding-the-installer-cache","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/rebuilding-the-installer-cache\/","title":{"rendered":"Rebuilding the Installer Cache"},"content":{"rendered":"<p>During some operations upgrades internally, a problem arose on some machines where a patch for the Microsoft .NET Framework 2.0 would fail to install. I was looped into the thread to diagnose the issue and found that the Windows Installer package and the patch package were both missing from the <a href=\"http:\/\/blogs.msdn.com\/heaths\/archive\/2005\/11\/29\/498018.aspx\">installer cache<\/a>. Since a <em>.msp<\/em> file is just a container for transforms and files that apply to a <em>.msi<\/em> file, the <em>.msi<\/em> file must exist in order to be <a href=\"http:\/\/blogs.msdn.com\/heaths\/archive\/2005\/09\/12\/464047.aspx\">transformed and reinstalled<\/a>. Any patches that are registered from previous installs must also exist, so when any of these files are missing it is a big problem.<\/p>\n<p>While only a couple of machines out of many exhibited this problem, it raised questions about why those files were missing. Windows Installer will clean-out the installer cache if ever the owner on the <em>%WINDIR%Installer<\/em> directory changes from SYSTEM or Administrators, so that is one likely cause. Perhaps a security template tried to &#8220;tighten&#8221; security. This does, however, yield a good opportunity to show how important verbose logs are when performing any Windows Installer action, as well as showing how source resolution works.\n<\/p>\n<p>Remember that to generate verbose logs, pass &#8220;\/L*v &lt;file name&gt;&#8221; (without quotes) to the command line for <em>msiexec.exe<\/em>. If using Windows Installer 3.0 or newer, you can also pass &#8220;x&#8221; along with &#8220;*v&#8221; to the logging switch for additional debug information.\n<\/p>\n<p>Take a look at the following rather long log snippet, with some portions highlighted for easy reference throughout the rest of this post.\n<\/p>\n<p><span style=\"font-family:Consolas;font-size:10pt\">           ******* Product: {B6EC01E7-431D-4D29-B9D4-E1D74CAF0AB0}<br \/>           ******* Action: <br \/>           ******* CommandLine: **********<br \/>MSI (c) (DC:10) [19:14:38:575]: Machine policy value &#8216;DisableUserInstalls&#8217; is 0<br \/><span style=\"background-color:yellow\">MSI (c) (DC:10) [19:14:38:575]: Warning: Local cached package &#8216;C:WINDOWSInstaller478d2c9.msi&#8217; is missing.<\/span><br \/>MSI (c) (DC:10) [19:14:38:606]: User policy value &#8216;SearchOrder&#8217; is &#8216;nmu&#8217;<br \/>MSI (c) (DC:10) [19:14:38:606]: User policy value &#8216;DisableMedia&#8217; is 0<br \/>MSI (c) (DC:10) [19:14:38:606]: Machine policy value &#8216;AllowLockdownMedia&#8217; is 0<br \/>MSI (c) (DC:10) [19:14:38:606]: SOURCEMGMT: Media enabled only if package is safe.<br \/>MSI (c) (DC:10) [19:14:38:606]: SOURCEMGMT: Looking for sourcelist for product {B6EC01E7-431D-4D29-B9D4-E1D74CAF0AB0}<br \/>MSI (c) (DC:10) [19:14:38:606]: SOURCEMGMT: Adding {B6EC01E7-431D-4D29-B9D4-E1D74CAF0AB0}; to potential sourcelist list (pcode;disk;relpath).<br \/>MSI (c) (DC:10) [19:14:38:622]: SOURCEMGMT: Now checking product {B6EC01E7-431D-4D29-B9D4-E1D74CAF0AB0}<br \/>MSI (c) (DC:10) [19:14:38:622]: SOURCEMGMT: Media is enabled for product.<br \/>MSI (c) (DC:10) [19:14:38:622]: SOURCEMGMT: Attempting to use LastUsedSource from source list.<br \/>MSI (c) (DC:10) [19:14:38:638]: SOURCEMGMT: Trying source C:WINDOWSMicrosoft.NETFramework64v2.0.50727Microsoft .NET Framework 2.0 (x64).<br \/>MSI (c) (DC:10) [19:14:39:263]: Cloaking enabled.<br \/>MSI (c) (DC:10) [19:14:39:263]: Attempting to enable all disabled priveleges before calling Install on Server<br \/><span style=\"background-color:lime\">MSI (c) (DC:10) [19:14:39:310]: SOURCEMGMT: Resolved source to: &#8216;C:WINDOWSMicrosoft.NETFramework64v2.0.50727Microsoft .NET Framework 2.0 (x64)&#8217;<\/span><br \/>MSI (c) (DC:10) [19:14:40:403]: SOFTWARE RESTRICTION POLICY: Verifying package &#8211;&gt; &#8216;C:WINDOWSMicrosoft.NETFramework64v2.0.50727Microsoft .NET Framework 2.0 (x64)netfx.msi&#8217; against software restriction policy<br \/>MSI (c) (DC:10) [19:14:40:403]: SOFTWARE RESTRICTION POLICY: C:WINDOWSMicrosoft.NETFramework64v2.0.50727Microsoft .NET Framework 2.0 (x64)netfx.msi has a digital signature<br \/>MSI (c) (DC:10) [19:14:40:419]: SOFTWARE RESTRICTION POLICY: C:WINDOWSMicrosoft.NETFramework64v2.0.50727Microsoft .NET Framework 2.0 (x64)netfx.msi is permitted to run at the &#8216;unrestricted&#8217; authorization level.<br \/>MSI (c) (DC:10) [19:14:40:419]: Cloaking enabled.<br \/>MSI (c) (DC:10) [19:14:40:419]: Attempting to enable all disabled priveleges before calling Install on Server<br \/>MSI (c) (DC:10) [19:14:40:419]: End dialog not enabled<br \/>MSI (c) (DC:10) [19:14:40:419]: Original package ==&gt; C:WINDOWSMicrosoft.NETFramework64v2.0.50727Microsoft .NET Framework 2.0 (x64)netfx.msi<br \/>MSI (c) (DC:10) [19:14:40:419]: Package we&#8217;re running from ==&gt; C:DOCUME~1th871LOCALS~1Temp1b4d214b.msi<br \/>MSI (c) (DC:10) [19:14:40:466]: APPCOMPAT: looking for appcompat database entry with ProductCode &#8216;{B6EC01E7-431D-4D29-B9D4-E1D74CAF0AB0}&#8217;.<br \/>MSI (c) (DC:10) [19:14:40:466]: APPCOMPAT: no matching ProductCode found in database.<br \/>MSI (c) (DC:10) [19:14:40:482]: MSCOREE not loaded loading copy from system32<br \/><span style=\"background-color:aqua\">MSI (c) (DC:10) [19:14:40:607]: Opening existing patch &#8216;C:WINDOWSInstallera4784a.msp&#8217;.<br \/>MSI (c) (DC:10) [19:14:40:607]: Note: 1: 2203 2: C:WINDOWSInstallera4784a.msp 3: -2147287038 <br \/>MSI (c) (DC:10) [19:14:40:607]: Couldn&#8217;t find local patch &#8216;C:WINDOWSInstallera4784a.msp&#8217;. Looking for it at its source.<\/span><br \/>MSI (c) (DC:10) [19:14:40:607]: Resolving Patch source.<br \/>MSI (c) (DC:10) [19:14:40:607]: User policy value &#8216;SearchOrder&#8217; is &#8216;nmu&#8217;<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Media enabled only if package is safe.<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Looking for sourcelist for product {76112B23-E8BF-4307-9638-9C1A22692A65}<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Adding {76112B23-E8BF-4307-9638-9C1A22692A65}; to potential sourcelist list (pcode;disk;relpath).<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Now checking product {76112B23-E8BF-4307-9638-9C1A22692A65}<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Media is enabled for product.<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Attempting to use LastUsedSource from source list.<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Trying source C:DOCUME~1th871LOCALS~1Temp1ZNW1.<br \/><span style=\"background-color:fuchsia\">MSI (c) (DC:10) [19:14:40:607]: Note: 1: 2203 2: C:DOCUME~1th871LOCALS~1Temp1ZNW1NDP20-KB913393-X64.msp 3: -2147287037<\/span>\n\t\t\t<br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Source is invalid due to missing\/inaccessible package.<br \/>MSI (c) (DC:10) [19:14:40:607]: Note: 1: 1706 2: -2147483647 3: NDP20-KB913393-X64.msp <br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Processing net source list.<br \/>MSI (c) (DC:10) [19:14:40:607]: Note: 1: 1706 2: -2147483647 3: NDP20-KB913393-X64.msp <br \/>MSI (c) (DC:10) [19:14:40:607]: SOURCEMGMT: Processing media source list.<br \/>MSI (c) (DC:10) [19:14:41:685]: SOURCEMGMT: Resolved source to: &#8216;NDP20-KB913393-X64.msp&#8217;<br \/>MSI (c) (DC:10) [19:14:42:107]: Note: 1: 1314 2: NDP20-KB913393-X64.msp <br \/>MSI (c) (DC:10) [19:14:42:107]: Unable to create a temp copy of patch &#8216;NDP20-KB913393-X64.msp&#8217;.\n<\/span><\/p>\n<p>In the log is all information necessary to rebuild the cache if needed. Uninstalling the product will not work because the <em>.msp<\/em> file is unavailable, and since the patch is registered to the product you will need any patches as well. Also note that the <em>.msi<\/em> file source location <span style=\"background-color:lime\">was resolved<\/span> in this example only because .NET 2.0 caches its source in its entirety. Only a few products do this, such as .NET 2.0 and the Visual Studio 2005 Express SKUs because of their relatively small size. Caching RTM <strong>sources<\/strong> on disk for larger SKUs like Visual Studio 2005 Professional and Visual Studio 2005 Team Suite isn&#8217;t feasible, though the <em>.msi<\/em> file itself is cached.\n<\/p>\n<p>If this problem occurred and a local source cache isn&#8217;t available, you can find the <span style=\"background-color:yellow\"><em>.msi<\/em> file name<\/span> so you can copy the original <em>.msi<\/em> file to that location &ndash; and it doesn&#8217;t have to be stripped of embedded cabinets. In this log, that location is <span style=\"background-color:yellow\"><em>C:WINDOWSInstaller478d2c9.msi<\/em><\/span>.\n<\/p>\n<p>Next, Windows Installer will look for any registered patches for that product. In this log there is one patch already installed, and Windows Installer is looking for <span style=\"background-color:aqua\"><em>C:WINDOWSInstallera4784a.msp<\/em><\/span>. You can typically find out what patch you need to download or otherwise obtain by looking at the following source resolution log lines. In this log, you see that Windows Installer is checking the temporary client source location which includes the file name, <span style=\"background-color:fuchsia\"><em>NDP20-KB913393-X64.msp<\/em><\/span>. Because of Microsoft&#8217;s naming conventions for sustained engineering, you know you need to download the patch for KB913393. From us you&#8217;ll actually download a <em>.exe<\/em> file, but you can pass &#8220;\/extract&#8221; on the command to extract the <em>.msp<\/em> file and copy it to, in this example, <span style=\"background-color:aqua\"><em>C:WINDOWSInstallera4784a.msp<\/em><\/span>.\n<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/source_resiliency.asp\">Source resolution<\/a> in Windows Installer can tell you a lot about locations of files. Many of the operation codes between <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/installinitialize_action.asp\">InstallInitialize<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/installfinalize_action.asp\">InstallFinalize<\/a> will also tell you a lot about the installation process, from where source for files are located as well as where files are being cached in the <a href=\"http:\/\/blogs.msdn.com\/heaths\/archive\/2006\/10\/06\/VS-2005-SP1-Requires-a-lot-of-Disk-Space.aspx\">baseline cache<\/a>. This is one of countless reasons you should always enable verbose logging &ndash; whether using a <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/logging.asp\">system policy<\/a> or on the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/command_line_options.asp\">command line<\/a> &ndash; when performing actions with Windows Installer. Provided that Windows Installer rolls back a failed install to leave the system in its previous state, little else is left to help diagnose the reason why the install action failed.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>During some operations upgrades internally, a problem arose on some machines where a patch for the Microsoft .NET Framework 2.0 would fail to install. I was looped into the thread to diagnose the issue and found that the Windows Installer package and the patch package were both missing from the installer cache. Since a .msp [&hellip;]<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[20,23,40],"class_list":["post-1863","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-installation","tag-logging","tag-troubleshooting"],"acf":[],"blog_post_summary":"<p>During some operations upgrades internally, a problem arose on some machines where a patch for the Microsoft .NET Framework 2.0 would fail to install. I was looped into the thread to diagnose the issue and found that the Windows Installer package and the patch package were both missing from the installer cache. Since a .msp [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/1863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=1863"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/1863\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=1863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=1863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=1863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}