SUMMARY
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 topGeneral 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 topSteps 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.
- 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:
\\MachineA\Share1\RTM
\\MachineA\Share1\RTM\AdminImage
\\MachineA\Share1\Sp1
\\MachineA\Share1\Sp1\AdminImage
\\MachineA\Share1\RTM\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. All Windows Installer SDK documents that letters 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:
msiexec.exe /a \\MachineA\Share1\RTM\Sample.msi TARGETDIR=\\MachineA\Share1\RTM\AdminImage /L*v \\MachineA\Share1\RTM\AdminImage\Admin.log
- 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
- 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.
- Make the patch creation properties file:
- 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:
- Add a row in the ImageFamilies table that has the following values:
|
Family | MSDEApps |
MediaSrcPropName | MSDE_SP1_UPDATE |
MediaDiskId | 2 |
FileSequenceStart | 1000 |
- Add a row in the UpgradedImages table that has the following values:
|
Upgraded | MSDE_sp1 |
MsiPath | \\MachineA\Share1\Sp1\AdminImage\Sqlrun01.msi |
Family | MSDEApps |
- Add a row in the TargetImages table that has the following values:
|
Target | MSDE_rtm |
MsiPath | \\MachineA\Share1\RTM\AdminImage\Sample.msi |
Upgraded | MSDE_sp1 |
Order | 1 |
ProductValidateFlags | 0x00000922 |
IgnoreMissingSrcFiles | 0 |
- Change the rows in the Properties table to the following values:
|
PatchOutPutpath | \\MachineA\Share1\Patch |
PatchGUID | Use a new GUID that is
generated by Guiden.exe. (Make sure that the GUID is in uppercase.) |
AllowProducctCodeMismatches | 0 |
AllowProductVersionMajorMismatches | 0 |
IncludeWholeFilesOnly | 1 |
- 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.
- Rename the Template.pcp file to
Msde.pcp.
- 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. - 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.
|
o | Reinstall if the file is missing, or if an earlier
version is present. |
m | 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. |
u | Rewrite all required registry entries from the Registry table that go to the HKEY_CURRENT_USER or HKEY_USERS registry
hive. |
s | Reinstall all shortcuts and re-cache all icons that
overwrite any existing shortcuts and icons. |
back to the top