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.
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:
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
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.
Create the folders, and then copy the files:
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.
Copy the Sample.msi and Sqlrun.cab 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 Sqlrun.cab file is located in the MSDE\Setup directory.
Copy the Sqlrun01.msi and Sqlrun.cab 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.
Change or verify the package code and the product code in the Sqlrun01.msi file.
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.
Change the product code in the Property table of Sqlrun01.msi to match the product code from your Sample.msi file.
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.
Create Windows Installer administrative images:
Create an administrative image for the Sample.msi file by using a command that is similar to the following:
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.
Test the patch file. Apply the patch on a computer that has Sample.msi installed by using the following sample command:
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.
Reinstall if the file is missing, or if an earlier version is present.
Rewrite 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.
Rewrite all required registry entries from the Registry table that go to the HKEY_CURRENT_USER or HKEY_USERS registry hive.
Reinstall all shortcuts and re-cache all icons that overwrite any existing shortcuts and icons.