Microsoft Knowledge Base Email Alertz

How to Resolve missing MSI or MSP packages during SQL Server Service Packs, Hotfix or Cumulative Updates

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 969052 - Last Review: April 12, 2012 - Revision: 9.0

How to restore the missing Windows Installer cache files and resolve problems that occur during a SQL Server update

On This Page

SYMPTOMS

When you try to install a Microsoft SQL Server service pack or a cumulative update, you may encounter one of the following error messages.

Note The following error messages can be found as text messages in the event log or in the Setup logs that are located in one of the following folders:
For SQL Server 2008 and for SQL Server 2008 R2: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap

For SQL Server 2012: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap


Error message 1
SQL Server Setup has encountered the following error:

The cached patch file "c:\Windows\Installer\1fdb1aec.msp" is missing. The original file for this cached file is "sql_engine_core_inst.msp", which can be installed from "Hotfix 1702 for SQL Server 2008 R2 (KB981355) (64-bit)", version 10.50.1702.0.

For more information about how to resolve this problem, see "Steps to resolve missing media issue with SQL Server 2008 R2" (http://go.microsoft.com/fwlink/?LinkId=144387) in the Microsoft Knowledge Base.

Error code 0x84B20001.

Error message 2
The cached MSI file 'C:\Windows\Installer\<file_encoded_name>.msi' is missing.
Its original file is ''C:\Windows\Installer\sql_<featurename>.msi' }' and it was installed for product 'Microsoft SQL Server <version>' from 'C:\originalfolder', version '<versionnumber>', language '<language>'.
To resolve this problem, recover the missing file from the installation media and start setup again.
For more information about how to resolve this problem, see 'Steps to restore the missing Windows Installer cache files' (http://go.microsoft.com/fwlink/?LinkId=144387) in the Microsoft Knowledge Base.

Error message 3
1603 Fatal error during installation.

Error message 4
1612 The installation source for this product is not available. Verify that the source exists and that you can access it.

Error message 5
1620 This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.

Error message 6

One of the two following messages:
1635 Unable to install Windows Installer MSP file


This update package could not be opened. Verify that the update package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer update package.

Error message 7

One of the two following messages:
1636 Unable to install Windows Installer MSP file


This update package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer update package.

Error message 8
1642 The upgrade cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade.

Error message 9
1706. The endpoint format is invalid.

Error message 10
1714 MSP Error: 1714 The older version of Microsoft SQL Server Native Client cannot be removed.
Contact your technical support group
File not found messages in the detailed log files

Error message 11
SOURCEMGMT: Source is invalid due to missing/inaccessible package.

Error message 12
Warning: Local cached package 'C:\Windows\Installer\file-name.msi' is missing.

Additionally, you may encounter similar error messages when you try to repair or remove the product components.

Note These error messages can also occur for reasons other than those that are listed in this article.

CAUSE

These problems may occur when the Windows Installer database file (.msi) or the Windows Installer patch file (.msp) is missing from the Windows Installer cache. The Windows Installer cache is located in the following folder:
%windir%\installer
When a product is installed by using Windows Installer, a stripped version of the original .msi file is stored in the Windows Installer cache. Every update to the product such as a hotfix, a cumulative update, or a service pack setup, also stores the relevant .msp or .msi file in the Windows Installer cache.

Any future update to the product such as a hotfix, a cumulative update, or a service pack setup, relies on the information in the files that are stored in the Windows Installer cache. Without this information, the new update cannot perform the required transformations.

RESOLUTION

Cumulative update information

SQL Server 2012

The fix for this issue was first released in Cumulative Update 1 for SQL Server 2012. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2679368  (http://kbalertz.com/Feedback.aspx?kbNumber=2679368/ ) Cumulative update package 1 for SQL Server 2012
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2692828  (http://kbalertz.com/Feedback.aspx?kbNumber=2692828/ ) The SQL Server 2012 builds that were released after SQL Server 2012 was released
You must apply a SQL Server 2012 hotfix to an installation of SQL Server 2012.

Note After you apply this hotfix, you receive a more detailed error message when the MSI files are missing. This message resembles error message 2 in the "Symptoms" section. The error message lets you know the missing MSI file name, the product name, and the product version. (You can also find this error message in Summary.txt and Detail.txt files.

To resolve these problems, use one of the following procedures.

Procedure 1: Use a script

To complete the steps in this procedure, you have to copy the FindSQLInstalls.vbs script from the "More Information" section to a local folder on the computer where you are trying to update your SQL Server installation.

Note The FindSQLInstalls.vbs script collects the information to correct invalid package paths. And, this script is used against the source locations to make sure that all MSP packages are in the Windows Installer cache directory. Any missing packages will be re-added if the original source media is available.

To resolve these problems by using a script, follow these steps:
  1. Locate the directory to which you saved the script content.
  2. Open an elevated command prompt to the directory to which you saved the script, and run the following command:
    Cscript FindSQLInstallsOnly.vbs %computername%_sql_install_details.txt
  3. Open the file from step 2 in a text editor such as Notepad, and identify the problems that are causing the failure. To do this, search the text file for string patterns such as the following:
    • do not
    • !!!
  4. Based on the results in step 3, take the steps that are required.

    Note Look for more information about these steps in the "Examples" section.

  5. Repeat steps 2 through 4 until the text file that is created in step 2 no longer contains text that references invalid paths or missing files for the component that is being updated.

Examples

The following examples are entries and explanations of actions that are outlined in the output file that is generated when you run the FindSQLInstalls.vbs script.

Example 1: Missing installer files
The following is an example of the output that is generated when you are missing an .msi package in the Windows Installer cache folder.
================================================================================
PRODUCT NAME   : Microsoft SQL Server 2008 Database Engine Services
================================================================================
  Product Code: {9FFAE13C-6160-4DD0-A67A-DAC5994F81BD}
  Version     : 10.2.4000.0
  Most Current Install Date: 20110211
  Target Install Location: 
  Registry Path: 
   HKEY_CLASSES_ROOT\Installer\Products\C31EAFF906160DD46AA7AD5C99F418DB\SourceList
     Package    : sql_engine_core_inst.msi
  Install Source: \x64\setup\sql_engine_core_inst_msi\
  LastUsedSource: m;1;G:\x64\setup\sql_engine_core_inst_msi\

The "LastUsedSource" line points to the location that was used to run the Setup program.

In the "LastUsedSource" line, the m; entry signifies media and indicates that the original source is CD/DVD media.

In the following example, the source is a CD or a DVD in drive G. If the installation occurred from a file folder or from a network share, the "LastUsedSource" line begins with an n; entry, followed by a Numeric_Data_Name; entry, and then the actual path:
!!!! sql_engine_core_inst.msi DOES NOT exist on the path in the path G:\x64\setup\sql_engine_core_inst_msi\ !!!!
 
Action needed, re-establish the path to G:\x64\setup\sql_engine_core_inst_msi\ 

The "Action needed" line shows you the full path that must exist in order to update missing files for the original installation media:
Installer Cache File: C:\WINDOWS\Installer\19b4d2.msi 

The "Installer Cache File" line confirms the name of the installer cache file:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! C:\WINDOWS\Installer\19b4d2.msi DOES NOT exist in the Installer cache. !!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The following section of the output advises you of actions that are required to resolve the missing files:
 Action needed, recreate or re-establish path to the directory:
     G:\x64\setup\sql_engine_core_inst_msi\then rerun this script to update installer cache and results
     The path on the line above must exist at the root location to resolve
     this problem with your msi/msp file not being found or corrupted,
     In some cases you may need to manually copy the missing file or manually
     replace the problem file overwriting it is exist: 
 
     Copy "G:\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi" C:\WINDOWS\Installer\19b4d2.msi
 
     Replace the existing file if prompted to do so.
Example 2: Missing patches
Missing patches may result in entries that resemble those in Example 1. Most of the time, you will notice entries in the "Patch LastUsedSource" line that reference a patch, and this line resembles the following:
Patch LastUsedSource:   n;1;c:\0ca91e857a4f12dd390f0821a3\HotFixSQL\Files\

This output indicates the following about the patch installation:
  • The original patch was installed by double-clicking the patch's executable file.
  • The installer for the patch used a temp folder, c:\0ca91e857a4f12dd390f0821a3, during installation of the patch.
  • To re-create the path, you must run the same executable and add the following parameter:
    /x:c:\0ca91e857a4f12dd390f0821a3
    Note This command forces the executable to extract the files to the previous missing location, and this re-creates the structure that is required to update the Windows installer cache with any missing files. The actual location will vary, and a single patch such as a service pack may have to be extracted to multiple locations. Each installed product includes a section that contains the following information for "Patches Installed":
    Display name:
    KB Article URL:  http://kbalertz.com/Feedback.aspx?kbNumber=<value>
    Patch LastUsedSource: 

    The "KB Article URL" line can help you download any patch media, if this is necessary.

Procedure 2: Manually restore the files

To manually restore the files that are missing from the Windows Installer cache, follow these steps:
  1. Collect the complete details about the missing file from the error message, from the setup log file, or from the registry entries that are maintained by the Windows Installer. For example, in Error Message 1 in the "Symptoms" section, all the information that is required to resolve the issue is present in the error message:
    • PatchName: "Hotfix 1702 for SQL Server 2008 R2 (KB981355) (64-bit)"
    • Original MSP file that is used by the Patch: sql_engine_core_inst.msp
    • Cached MSP file: c:\Windows\Installer\1fdb1aec.msp
  2. If you do not have all the details, see the "More information for Procedure 2" section for the steps to collect these details.
  3. Visit http://support.microsoft.com (http://support.microsoft.com) , and search for the KB article that is associated with this patch. In this example, you must search for KB981355.
  4. Download this patch package to your computer. Make sure that you download the patch package that corresponds to the required platform. In this example, the package is SQLServer2008R2-KB981355-x64.exe.
  5. Extract the contents of the patch package by using the following syntax:
    C:\Temp>SQLServer2008R2-KB981355-x64.exe /x C:\Temp\SQLServer2008R2-KB981355-x64\
  6. Locate the original msp file sql_engine_core_inst.msp file. The file should be in the following folder:
    C:\Temp\SQLServer2008R2-KB981355-x64\x64\setup\sql_engine_core_inst_msi\
  7. Copy this original msp file to the following Windows Installer cache:
    %windir%\installer\
  8. Rename the original msp file, sql_engine_core_inst.msp, to the following name:
    cached msp file 1fdb1aec.msp

You can start the Setup program for the update that resulted in the error and resume the update process. You may encounter this message for a missing Windows Installer cache file for another component or for another update of the same product.

To obtain a list of all the missing Windows Installer cache files that are related to the SQL Server product components, you can download the SQL Server 2008 R2 BPA tool that is mentioned in the "More Information" section.

If the error message references a missing Windows Installer database file (.msi), you do not have to perform steps 2 through 4. Instead, you can go directly to step 5. You have to locate the .msi from the original media that you used to install the product. If this error message was generated for sql_engine_core_inst.msi, then you have to locate this file from the setup media under the following folder structure:
\x64\setup\sql_engine_core_inst_msi\
The other steps are the same.

More information for Procedure 2

How to find the patch package and the product details for a missing .msp file
Different versions of the product generate different error messages for this problem. The error messages that are mentioned in the "Symptoms" section appear for Setup programs for updates starting with Microsoft SQL Server 2008 SP1. For other updates, you receive error messages that may not clearly specify which patch file is missing from the Windows Installer cache and the specific update details. For these error messages, the setup log files will contain information about the missing Windows Installer cache file. A sample setup log resembles the following:
MSI (s) (FC:F8) [13:48:58:649]: Opening existing patch 'C:\WINDOWS\Installer\145258.msp'.
MSI (s) (FC:F8) [13:48:58:649]: Couldn't find local patch 'C:\WINDOWS\Installer\145258.msp'. Looking for it at its source.
MSI (s) (FC:F8) [13:48:58:649]: Resolving Patch source.
MSI (s) (FC:F8) [13:48:58:649]: Note: 1: 2203 2: D:\cda162709d239766830bae5ce12b\HotFixSQL\Files\sqlrun_sql.msp 3: -2147287037 
MSI (s) (FC:F8) [13:48:58:649]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (FC:F8) [13:49:29:961]: Product: Microsoft SQL Server 2005 -- Installation failed.
MSI (s) (FC:F8) [13:49:29:992]: MainEngineThread is returning 1635
This patch package could not be opened.  Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package.
D:\SQL2K5\Servers\Setup\SqlRun_SQL.msi

If you examine this setup log carefully, it already gives you the information about the Original MSP file that was used by the following patch:
sqlrun_sql.msp


To find more details about the missing .msp file in the Windows Installer cache, follow these steps:
  1. Search for the missing .msp file in the following Windows Installer Patches registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Patches\
  2. Find the Patch GUID.
  3. Search for the Patch GUID in the following Windows Installer Products registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\
For the sample setup log, the information about the missing .msp file and its corresponding patch details are present in the following registry entries:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Patches\A3B085EA74A9A7640A496636F7EF9A44

Value: 0
Name: LocalPackage
Data: C:\WINDOWS\Installer\145258.msp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\1EB3A031CC585314E87AA527E46EECC2\Patches\A3B085EA74A9A7640A496636F7EF9A44
Value: 6
Name: DisplayName
Data: GDR 2050 for SQL Server Database Services 2005 ENU (KB932555)

Now you have all the information points to start the steps to resolve the missing files in the Windows Installer cache.

Note If you use Microsoft SQL Server 2008 Service Pack 3 (SP3) or a later version, you can also receive a similar error message for the missing .msi files. By using this error message, you can quickly determine which file is missing, what service pack to download, and where you can find the download.

For more information about how to obtain the service pack, click the following article number to view the article in the Microsoft Knowledge Base:
2546951  (http://kbalertz.com/Feedback.aspx?kbNumber=2546951/ ) List of the bugs that are fixed in SQL Server 2008 Service Pack 3

MORE INFORMATION

For more information about Windows Installer database (.msi) files, visit the following Microsoft Developer Network (MSDN) website:
Installer Database (http://msdn.microsoft.com/en-us/library/aa369395(VS.85).aspx)
For more information about Windows Installer patch (.msp file) files, visit the following MSDN website:
Patch Packages (http://msdn.microsoft.com/en-us/library/aa370596(VS.85).aspx)
For more information about the internal details of the Windows Installer cache, see the following MSDN blog:
Windows Installer Cache (http://blogs.msdn.com/b/heaths/archive/2005/11/29/498018.aspx)
For more information about the patching process, see the following MSDN blog:
How Patching Works (http://blogs.msdn.com/b/heaths/archive/2005/09/12/464047.aspx)
For more information about how to make sure that you cache the patch file for the correct platform, see the following MSDN blog:
SQL Server Setup prompts with "The installed product does not match the installation source(s)" (http://blogs.msdn.com/b/psssql/archive/2009/07/23/sql-server-setup-prompts-with-the-installed-product-does-not-match-the-installation-source-s-part-i.aspx)
For more information about why any product that uses the Windows Installer can encounter this problem, see the following MSDN blog:
Rebuilding the Installer Cache (http://blogs.msdn.com/b/heaths/archive/2006/11/30/rebuilding-the-installer-cache.aspx)
For more information about the details about different sets of error messages that appear in the setup log files, see the following MSDN blog:
Part - 1 : SQL Server 2005 Patch Fails to install with an error "Unable to install Windows Installer MSP file" (http://blogs.msdn.com/b/sqlserverfaq/archive/2009/01/30/part-1-sql-server-2005-patch-fails-to-install-with-an-error-unable-to-install-windows-installer-msp-file.aspx)


For more information about the products or tools that automatically check for this condition on your instance of SQL Server and on the versions of the SQL Server product, see the following table:
Collapse this tableExpand this table
Rule softwareRule titleRule descriptionProduct versions against which the rule is evaluated
SQL Server 2008 R2 Best Practice Analyzer (SQL Server 2008 R2 BPA)Setup - Installer cache is missing for the SQL InstallationThe SQL Server 2008 R2 Best Practice Analyzer (SQL Server 2008 R2 BPA) provides a rule to detect Missing Installer cache file for SQL Server components. The SQL Server 2008 R2 BPA supports both SQL Server 2008 and SQL Server 2008 R2. If you run the BPA tool and encounter an Error with the title of Setup - Installer cache is missing for the SQL Installation, and then the cache files are missing from the cache folder.SQL Server 2008
SQL Server 2008 R2
SQL Server 2012 Best Practice Analyzer (SQL Server 2012 BPA)Setup - Installer cache is missing for the SQL InstallationThe SQL Server 2012 Best Practice Analyzer (SQL Server 2012 BPA) provides a rule to detect Missing Installer cache file for SQL Server components.If you run the BPA tool and encounter an Error with the title of Setup - Installer cache is missing for the SQL Installation,and then the cache files are missing from the cache folder.SQL Server 2012



FindSQLInstalls.vbs script

' Copyright © Microsoft Corporation.  All Rights Reserved.
' This code released under the terms of the 
' Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
 
 
On Error Resume Next
 
Dim arrSubKeys, arrSubKeys2
Dim objFSO, objShell, objFile, objReg, objConn, objExec
Dim strComputer, strKeyPath, strNewSource
Dim strWorkstationName, strDBPath, strSubKey, strSubKey2(), strKeyPath02,  strRetValue00
Dim strRetValue01, strRetValue02, strRetValNew02, strRetValNew03, strRetValNew04, strRetValNew05, strRetValNew06, strRetValNew07, strRetValNew08, strRetValNew09, strRetValue10, strRetValNew10, strRetValNew11, strRetValNew12, strRetValNew13, strRetValNew14, strRetValNew14a, strRetValNew14b, strRetValNew15, strRetValNew15a, strRetValNew15b, strRetValNew16, strRetValNew17, strRetValNew18
 
Const HKCR = &H80000000 'HKEY_CLASSES_ROOT
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Const ForReading = 1, ForWriting = 2, ForAppEnding = 8
 
' Checking for Elevated permissions
Dim oShell, oExec
szStdOutszStdOut = ""
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("whoami /groups")
 
Do While (oExec.Status = cnWshRunning)
    WScript.Sleep 100
       if not oExec.StdOut.AtEndOfStream Then
                szStdOut = szStdOut & oExec.StdOut.ReadAll
       end If
Loop
 select case oExec.ExitCode
   case 0
       if not oExec.StdOut.AtEndOfStream Then
           szStdOut = szStdOut & oExec.StdOut.ReadAll
       End If
       If instr(szStdOut,"Mandatory Label\High Mandatory Level") Then
                wscript.echo "Elevated, executing script and gathering requested data"
       Else
           if instr(szStdOut,"Mandatory Label\Medium Mandatory Level")  Then
          Wscript.echo "Not Elevated must run from Administrative commmand line."
       Else
          Wscript.echo "Gathering requested data..."
           end If
      End If
   case Else
       if not oExec.StdErr.AtEndOfStream Then
          wscript.echo oExec.StdErr.ReadAll
       end If
       end select
 
'
' Leaving strNewSource will result in no search path updating.
' Currently DO NOT EDIT these.
strNewSource = ""
strNewRTMSource = ""
 
' Define string values
strComputer = "."
strSQLName = "SQL"
strDotNetName = ".NET"
strVStudioName = "Visual Studio"
strXML = "XML"
strOWC = "Microsoft Office 2003 Web Components"
strKeyPath = "Installer\Products"
strKeyPath2 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
strNValue00 = "ProductName"
strNValue01 = "PackageName"
strNValue02 = "LastUsedSource"
strNValue03 = "InstallSource"
strNValue04 = "LocalPackage"
strNValue05 = "DisplayVersion"
strNValue06 = "InstallDate"
strNValue07 = "UninstallString"
strNValue08 = "PackageCode"
strNValue09 = "MediaPackage"
strNValue10 = "InstallSource"
strNValue11 = "AllPatches"
strNValue12 = "NoRepair"
strNValue13 = "MoreInfoURL"
strNValue14 = "PackageName"
strNValue15 = "LastUsedSource"
strNValue16 = "Uninstallable"
strNValue17 = "DisplayName"
strNValue18 = "Installed"
 
If WScript.arguments.count <> 1 Then
   WScript.echo "Usage: cscript " & WScript.scriptname & " outputfilename.txt"
   WScript.quit
End If
 
'--Setup the output file
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtFile = fso.OpenTextFile(WScript.arguments(0), ForWriting, True)
If err.number <> 0 Then
    WScript.echo "Error 0x" & myHex(err.number,8) & ": " & err.source & " - " & err.description
    WScript.quit
End If
 
txtFile.writeline "Products installed on the local system"
txtFile.writeline " "
txtFile.writeline " "
 
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
 
'--Set up the registry provider.
Set objReg = GetObject("winmgmts:\\" & strComputer & _
"\root\default:StdRegProv")
 
Set wiInstaller = CreateObject("WindowsInstaller.Installer")
 
'--Enumerate the "installer\products" key on HKCR
objReg.EnumKey HKCR, strKeyPath, arrSubKeys
 
For Each strSubKey In arrSubKeys
 
' Define the various registry paths
strProduct01 = "Installer\Products\" & strSubKey
strKeyPath02 = "Installer\Products\" & strSubKey & "\SourceList"
strKeyPath03 = "Installer\Products\" & strSubKey & "\SourceList\Media"
strInstallSource = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" & strSubKey & "\InstallProperties\"
strInstallSource2 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" & strSubKey & "\patches\"
strInstallSource3 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Patches"
strInstallSource5 = "SOFTWARE\Classes\Installer\Patches\"
strInstallSource6 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strInstallSource7 = "SOFTWARE\Microsoft\Microsoft SQL Server\"
strInstallSource8 = "SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\"
 
' Pull the intial values
objReg.GetStringValue HKCR, strProduct01, strNValue00, strRetValue00
objReg.GetStringValue HKCR, strKeyPath02, strNValue01, strRetValue01
objReg.GetStringValue HKCR, strKeyPath02, strNValue02, strRetValue02
strRetValNew02 = Mid(strRetValue02, 5)
objReg.GetStringValue HKCR, strKeyPath03, strNValue09, strRetValue09
strRetValue10 = strNewRTMSource & strRetValue09
objReg.GetStringValue HKLM, strInstallSource, strNValue03, strRetValNew03
objReg.GetStringValue HKLM, strInstallSource, strNValue04, strRetValNew04
objReg.GetStringValue HKLM, strInstallSource, strNValue05, strRetValNew05
objReg.GetStringValue HKLM, strInstallSource, strNValue06, strRetValNew06
objReg.GetStringValue HKLM, strInstallSource, strNValue07, strRetValNew07
objReg.GetStringValue HKLM, strInstallSource, strNValue10, strRetValNew10
objReg.GetStringValue HKLM, strInstallSource, strNValue12, strRetValNew12
objReg.GetStringValue HKLM, strInstallSource, strNValue13, strRetValNew13
objReg.GetStringValue HKLM, strInstallSource2, strNValue11, strRetValNew11
 
' Pull the Product Code from the Uninstall String
strProdCode = strRetValNew07
  ProdCodeLen = Len(strProdCode)
  ProdCodeLen = ProdCodeLen - 14
strRetValNew08 = Right(strProdCode, ProdCodeLen)
 
' Pull out path from LastUsedSource
strGetRealPath = strRetValue02
  GetRealPath = Len(strRetValue02)
strRealPath = Mid(strRetValue02, 5, GetRealPath)
 
' Identifie the string in the ProductName
If instr(1, strRetValue00, strSQLName, 1) Then
' Start the log output
    txtFile.writeline "================================================================================"
    txtFile.writeline "PRODUCT NAME   : " & strRetValue00
    txtFile.writeline "================================================================================"
    txtFile.writeline "  Product Code: " & strRetValNew08
    txtFile.writeline "  Version     : " & strRetValNew05
    txtFile.writeline "  Most Current Install Date: " & strRetValNew06
    txtFile.writeline "  Target Install Location: "  & strRetValNew13
    txtFile.writeline "  Registry Path: "
    txtFile.writeline "   HKEY_CLASSES_ROOT\" & strKeyPath02
    txtFile.writeline "     Package    : " & strRetValue01
    txtFile.writeline "  Install Source: " & strRetValue10
    txtFile.writeline "  LastUsedSource: " & strRetValue02
'   txtFile.writeline "Does this file on this path exist? " & strRetValNew02 & "\" & strRetValue01
    If fso.fileexists(strRetValNew02 & "\" & strRetValue01) Then
    txtFile.writeline  " "
        txtFile.writeline "    " & strRetValue01 & " exists on the LastUsedSource path, no actions needed."
    Else
        txtFile.writeline " "
        txtFile.writeline " !!!! " & strRetValue01 & " DOES NOT exist on the path in the path " & strRealPath & " !!!!"
        txtFile.writeline " "
        txtFile.writeline " Action needed, re-establish the path to " & strRealPath
' Placeholder for altering the LastUsedSource by adding source location and Forcing search of list
'        If strNewSource <> "" Then
'        txtFile.writeline "      New Install Source Path Added: " & strNewSource
'        wiInstaller.AddSource strRetValNew08, "", strNewSource
'        Else
'        If strNewRTMSource <> "" Then
'        wiInstaller.AddSource strRetValNew08, "", strNewRTMSource
'        txtFile.writeline "      Forcing SourceList Resolution For: " & strRetValNew08
'        wiInstaller.ForceSourceListResolution strRetValNew08, ""
'        End If
'        End If
    End If
        txtFile.writeline " "
        txtFile.writeline "Installer Cache File: " & strRetValNew04
    If fso.fileexists(strRetValNew04) Then
        txtFile.writeline " "
        txtFile.writeline "    Package exists in the Installer cache, no actions needed."
        txtFile.writeline "    Any missing packages will update automatically if needed assuming that"
        txtFile.writeline "    the LastUsedSource exists."
        txtFile.writeline " "
        txtFile.writeline "    Should you get errors about " & strRetValNew04 & " or " & strRealPath & strRetValue01 & " then you"
        txtFile.writeline "    may need to manually copy the file, if file exists replace the problem file, " 
        txtFile.writeline "    Copy and paste the following command line into an administrative command prompt:"
        txtFile.writeline " "
        txtFile.writeline "     Copy " & chr(34) & strRealPath  & strRetValue01 & chr(34) & " " &strRetValNew04
        txtFile.writeline " "
    ElseIf fso.fileexists(strRetValNew02 & "\" & strRetValue01) Then
              fso.CopyFile strRetValNew02 & "\" & strRetValue01, strRetValNew04
        If fso.fileexists(strRetValNew04) Then
          txtFile.writeline " "
          txtFile.writeline "     Missing cache file replaced by copying " & strRealPath  & strRetValue01 & " to " & strRetValNew04
          txtFile.writeline "     Previously missing package " & strRetValNew04 &  " now exists in the Installer cache."
          txtFile.writeline " "
        End If
    Else
        txtFile.writeline " "
        txtFile.writeline " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
        txtFile.writeline " !!!! " & strRetValNew04 & " DOES NOT exist in the Installer cache. !!!!"
        txtFile.writeline " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
        txtFile.writeline " "
        txtFile.writeline "     Action needed, recreate or re-establish path to the directory:"
        txtFile.writeline "       " & strRealPath & "then rerun this script to update installer cache and results"
        txtFile.writeline "     The path on the line above must exist at the root location to resolve"
        txtFile.writeline "     this problem with your msi/msp file not being found or corrupted,"
        txtFile.writeline "     In some cases you may need to manually copy the missing file or manually"
        txtFile.writeline "     replace the problem file overwriting it is exist: " 
        txtFile.writeline " "
        txtFile.writeline "     Copy " & chr(34) & strRealPath  & strRetValue01 & chr(34) & " " &strRetValNew04
        txtFile.writeline " "
        txtFile.writeline "     Replace the existing file if prompted to do so."
        txtFile.writeline " "
    End If
    txtFile.writeline " "
    txtFile.writeline strRetValue00 & " Patches Installed "
    txtFile.writeline "--------------------------------------------------------------------------------"
 
    err.clear
    objReg.EnumKey HKLM, strInstallSource2, arrSubKeys2
    uUpperBounds = UBound(arrSubKeys2,1)
     If err.number = 0  Then
        For Each strSubKey2 in arrSubKeys2
    '    WScript.echo "value = " & strSubKey2
 
strKeyPath04 = "Installer\Patches\" & strSubKey2 & "\SourceList"
 
     objReg.GetDWORDValue HKLM, strInstallSource2 & "\" & strSubKey2 & "\", strNValue16, strRetValue16
     objReg.GetStringValue HKCR, strKeyPath04, strNValue15, strRetValue15a
     objReg.GetStringValue HKCR, strKeyPath04, strNValue14, strRetValue14a
     objReg.GetStringValue HKCR, strKeyPath02, strNValue15, strRetValue15b
     objReg.GetStringValue HKCR, strKeyPath02, strNValue14, strRetValue14b
     objReg.GetStringValue HKLM, strInstallSource2 & "\" & strSubKey2 & "\", strNValue17, strRetValue17
     objReg.GetStringValue HKLM, strInstallSource2 & "\" & strSubKey2 & "\", strNValue18, strRetValue18
     objReg.GetStringValue HKLM, strInstallSource2 & "\" & strSubKey2 & "\", strNValue13, strRetValue13a
     objReg.GetStringValue HKLM, strInstallSource3 & "\" & strSubKey2 & "\", strNValue04, strRetValue04a
 
' Pull the URL from the MoreInfoURL String
strMoreInfoURL = strRetValue13a
  MoreInfoURLLen = Len(strMoreInfoURL)
strRetValue13b = Right(strMoreInfoURL, 42)
 
' Pull the URL from the LastUsedPath String
strLastUsedPath = strRetValue15a
  LastUsedPathLen = Len(strLastUsedPath)
  'LastUsedPathLen = LastUsedPathLen - 15
strRetValue15c = Mid(strLastUsedPath, 5)
 
      txtFile.writeline " Display Name:    " & strRetValue17 
      txtFile.writeline " KB Article URL:  " & strRetValue13b
      txtFile.writeline " Install Date:    " & strRetValue18 
              txtFile.writeline "   Uninstallable:   " & strRetValue16 
      txtfile.writeline " Patch Details: "
      txtFile.writeline "   HKEY_CLASSES_ROOT\Installer\Patches\" & strSubKey2
              txtFile.writeline "   PackageName:   " & strRetValue14a
' Determine if someone has modified the Uninstallable state from 0 to 1 allowing possible unexpected uninstalls
              txtFile.writeline "    Patch LastUsedSource: " & strRetValue15a 
              txtFile.writeline "   Installer Cache File Path:     " & strRetValue04a 
        txtFile.writeline "     Per " & strInstallSource3 & "\" & strSubKey2 & "\" & strNValue04
              mspFileName = (strRetValue15c  & strRetValue14a)
      If strRetValue14a <> "" Then
      If fso.fileexists(strRetValue04a) Then
        txtFile.writeline " "
        txtFile.writeline "    Package exists in the Installer cache, no actions needed."
        txtFile.writeline "    Package will update automatically if needed assuming that"
        txtFile.writeline "    the LastUsedSource exists."
        txtFile.writeline " "
        txtFile.writeline "    Should you get errors about " & strRetValue04a & " or " & strRetValue15c  & strRetValue14a & " then you"
        txtFile.writeline "    may need to manually copy missing files, if file exists replace the problem file, " 
        txtFile.writeline "    Copy and paste the following command line into an administrative command prompt."
        txtFile.writeline " "
        txtFile.writeline "     Copy " & chr(34) & strRetValue15c  & strRetValue14a & chr(34) & " " & strRetValue04a
        txtFile.writeline " "
      ElseIf fso.fileexists(mspFileName) Then
              fso.CopyFile mspFileName, strRetValue04a
          If fso.fileexists(strRetValue04a) Then
          txtFile.writeline " "
          txtFile.writeline " Missing cache file replaced by copying " & strRetValue15c  & strRetValue14a & " to " & strRetValue04a
          txtFile.writeline " Previously missing package " & strRetValNew04 &  " now exists in the Installer cache."
          txtFile.writeline " "
          End If
'        End If
      Else
        txtFile.writeline " "
        txtFile.writeline "!!!! " & strRetValue04a & " package DOES NOT exist in the Installer cache. !!!!"
        txtFile.writeline " "
        txtFile.writeline "     Action needed, recreate or re-establish path to the directory:"
        txtFile.writeline "       " & strRetValue15c & " then rerun this script to update installer cache and results"
        txtFile.writeline "     The path on the line above must exist at the root location to resolve"
        txtFile.writeline "     this problem with your msi/msp file not being found or corrupted,"
        txtFile.writeline "     In some cases you may need to manually copy missing files or manually"
        txtFile.writeline "     replace the problem file, " 
        txtFile.writeline " "
        txtFile.writeline "     Copy " & chr(34) & strRetValue15c  & strRetValue14a & chr(34) & " " & strRetValue04a
        txtFile.writeline " "
        txtFile.writeline "     Replace the existing file if prompted to do so."
        txtFile.writeline " "
        txtFile.writeline "     Use the following URL to assist with downloading the patch:"
        txtFile.writeline "      " & strRetValue13b
        txtFile.writeline " "
        txtFile.writeline " "
      End If
       Else
        txtFile.writeline " "
     End If
        next
     Else
        txtfile.writeline " "
        txtfile.Writeline "  No Patches Found"
        txtfile.writeline " "
    End If
 
    End If
 
 
Next
txtFile.Close
Set txtFile = Nothing
Set fso = Nothing

APPLIES TO
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Enterprise Evaluation
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Express with Advanced Services
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Standard Edition for Small Business
  • Microsoft SQL Server 2008 Web
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2008 R2 Datacenter
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Express
  • Microsoft SQL Server 2008 R2 Express with Advanced Services
  • Microsoft SQL Server 2008 R2 Standard
  • Microsoft SQL Server 2008 R2 Standard Edition for Small Business
  • Microsoft SQL Server 2008 R2 Web
  • Microsoft SQL Server 2008 R2 Workgroup
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Evaluation Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Express Edition with Advanced Services
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2012 Developer
  • Microsoft SQL Server 2012 Enterprise
  • Microsoft SQL Server 2012 Express
  • Microsoft SQL Server 2012 Standard
  • Microsoft SQL Server 2012 Web
Keywords: 
kbexpertiseinter kbprb kbsurveynew KB969052
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate