You are currently offline, waiting for your internet to reconnect

How To Create Patch Files for the MSDE 2000 Sample.msi File

This article has been archived. It is offered "as is" and will no longer be updated.
This article describes how to create a patch file for Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) named Sample.msi. Sample.msi is a sample package that is included with the development tools of SQL Server Standard, SQL Server Enterprise, and the SQL Server Developer Editions.

back to the top

General Information

You can use the Sample.msi file to package MSDE 2000 with your application. With the use of the Sample.msi file, you can change the product code and the package code in it so that your setup package does not conflict with other products that are installed on the same computer. For more information, see the "Managing Desktop Engine Installation Package Files" topic in SQL Server 2000 Books Online.

To create patch files for MSDE 2000, you must have a solid understanding of Windows Installer technologies. For more information about Windows Installer technologies, please visit the following Microsoft Web site to view the Windows Installer SDK documentation:

You must have Windows Installer SDK version 1.5 or 2.0 installed to follow the sample steps that are described in this article. Windows Installer SDK 2.0 is included as part of the Windows Platform SDK. Additionally, make sure that the appropriate path exists for the following files:

  • Orca.exe
  • Guidgen.exe
  • Msimsp.exe
  • Makecab.exe
  • Patchwiz.dll
You must be familiar with the Orca.exe tool to perform basic editing, to change the product code, to change the package code, and to add and to modify rows to database tables inside the .msi file.

For additional information about how to use Orca.exe, click the article number below to view the article in the Microsoft Knowledge Base:
255905 How To Use the Orca Database Editor to Edit Windows Installer Files
back to the top

Steps to Create the Service Pack Patch

These sample steps describe how to create a Service Pack 1 patch for the MSDE 2000 Release to Manufacturer (RTM) Sample.msi.

NOTE: You can substitute Service Pack 1 with Service Pack 2.
  1. Create the folders, and then copy the files:
    1. This article uses an example share named \\MachineA\Share1. While following the sample steps, you must use your share folder according to your own computer share setting. Make the folder structure resemble the following structure and make sure that you have full control permissions on all the shares while you create the patch:


      NOTE: The folders can be local. Additionally, you can use the Universal Naming Convention (UNC) when you build a patch if the resource is from different computers.
    2. Copy the Sample.msi and files from MSDE 2000 RTM to the \\MachineA\Share1\RTM folder. If you previously modified the Sample.msi file (by modifying the product code, the package code, or the name of the Sample.msi), copy the modified Sample.msi file.

      NOTE: The Sample.msi file is located in the Devtools\Samples\Desktop directory, and the file is located in the MSDE\Setup directory.
    3. Copy the Sqlrun01.msi and files from MSDE 2000 Service Pack 1 to the \\MachineA\Share1\Sp1 folder.

      NOTE: Sqlrun01.msi and SP1 merge modules or Sqlrun01.msi and SP2 merge modules were released to MSDN Universal subscribers.
  2. Change or verify the package code and the product code in the Sqlrun01.msi file.

    1. NOTE: When you generate a globally unique identifier (GUID), make sure to convert it to all uppercase. This applies to all GUIDs that are mentioned in this article. The letters of all Windows Installer SDK documents in product code and package code GUIDs must be uppercase. Because the Guidgen.exe utility generates GUIDs that contain lowercase letters, you must change the lowercase letters in these GUIDs to uppercase before you use them as product code or package code.

    2. Change the product code in the Property table of Sqlrun01.msi to match the product code from your Sample.msi file.
    3. Use the Guidgen.exe tool to generate a new GUID. Make sure the new GUID is in uppercase. From the summary information of Sqlrun01.msi, change the package code to the new GUID by using the Orca.exe tool or the Msiinfo.exe tool.
  3. Create Windows Installer administrative images:

    1. Create an administrative image for the Sample.msi file by using a command that is similar to the following:
      msiexec.exe /a \\MachineA\Share1\RTM\Sample.msi TARGETDIR=\\MachineA\Share1\RTM\AdminImage /L*v \\MachineA\Share1\RTM\AdminImage\Admin.log
    2. Create an administrative image for the Sqlrun01.msi file by using a command that is similar to the following:
      msiexec.exe /a \\MachineA\Share1\sp1\Sqlrun01.msi TARGETDIR=\\MachineA\Share1\Sp1\AdminImage /L*v \\MachineA\Share1\Sp1\AdminImage\Admin.log
    3. Use the Orca.exe tool or the Msiinfo.exe tool and make sure that the two .msi files from the preceding two AdminImage folders are not compressed.
  4. Make the patch creation properties file:

    1. Copy the Template.pcp file from Windows Installer SDK to \\MachineA\Share1\Patch, and then use the Orca.exe tool to perform the following changes in the tables or the summary information respectively:
      1. Add a row in the ImageFamilies table that has the following values:
      2. Add a row in the UpgradedImages table that has the following values:

      3. Add a row in the TargetImages table that has the following values:

      4. Change the rows in the Properties table to the following values:
        PatchGUIDUse a new GUID that is generated by Guiden.exe. (Make sure that the GUID is in uppercase.)
      5. Change the package code of the Template.pcp file to a new GUID that is generated by Guidgen.exe. Make sure the GUID is in uppercase letters.
      6. Rename the Template.pcp file to Msde.pcp.
    2. Make the patch file by using the Msimsp.exe tool. You can use a command that is similar to the following sample command:
      msimsp.exe -s \\MachineA\Share1\Patch\msde.pcp -p \\MachineA\Share1\Patch\Sample.msp -l \\MachineA\Share1\Patch\log.txt -f \\MachineA\Share1\Patch\tmp
      Check the Log.txt log file to make sure that no error occurs after the Msimsp.exe tool creates the patch. If the Msimsp.exe tool successfully creates the patch, a file named Sample.msp is in the \\MachineA\Share1\Patch folder.
    3. Test the patch file. Apply the patch on a computer that has Sample.msi installed by using the following sample command:
      Msiexec.exe /p Sample.msp REINSTALL=ALL REINSTALLMODE=omus /L*v SamplePatch.txt

      Check the SamplePatch.txt log file to make sure the patch installation is successful.

      NOTE: REINSTALL=ALL means to reinstall only those features that were already previously installed. Additionally, if you set the REINSTALL property, you must set the REINSTALLMODE property to indicate the type of reinstall that you are going to perform.
      oReinstall if the file is missing, or if an earlier version is present.
      mRewrite all required registry entries from the Registry table that go to the KEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT registry hive. Rewrite all information from the Class table, Verb table, PublishComponent table, ProgID table, MIME table, Icon table, Extension table, and AppID table regardless of machine or user assignment. Reinstall all qualified components.
      uRewrite all required registry entries from the Registry table that go to the HKEY_CURRENT_USER or HKEY_USERS registry hive.
      sReinstall all shortcuts and re-cache all icons that overwrite any existing shortcuts and icons.
back to the top
MSDE Minor upgrade Patch Installer

Article ID: 314131 - Last Review: 12/07/2015 08:19:59 - Revision: 2.0

  • kbnosurvey kbarchive kbproductlink kbhowto kbhowtomaster KB314131