HOW TO: Use AppSearch in a Windows Installation Package (827019)
The information in this article applies to:
- Microsoft Windows Installer
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft Platform Software Development Kit (SDK) 1.0
SUMMARYThis step-by-step article discusses how to use
the AppSearch tool in a Microsoft Windows Installer package installation. Windows Installer can
use AppSearch to search for a specified registry entry, file, or folder while installing your
package. AppSearch searches your computer for file signatures
that you specify in the AppSearch table of the Windows Installer package. If AppSearch locates a
file, a registry key, or a folder that has the signature that you specified, AppSearch returns search results as a property. You can use
this property to establish a launch condition. If the condition that you set is not satisfied, the launch condition quits
the installation process. AppSearch uses database tables such as the following while searching for files, registry keys, and folders:
- Signature
- AppSearch
- DrLocator
- RegLocator
- CompLocator
You can use a table editor tool such as Orca to create or to edit database tables in Windows Installer
packages. The sample discusses how to search for the System.Windows.Forms.dll file during installation of a Windows Installer package that you create by using
Microsoft Visual Studio .NET. The sample uses the Orca editor to modify the .msi
file and to add the search condition. back to
the topRequirementsThe following list outlines the recommended hardware,
software, network infrastructure, and service packs that you need: - Microsoft Windows 2000, Microsoft Windows XP, or Microsoft
Windows Server 2003
- Microsoft Visual Studio .NET
- Microsoft Platform Software Development Kit (SDK)
This article assumes that you are familiar with the
following topics: - Visual Studio .NET Setup Projects
- Orca.exe
back to the
topCreate a Windows Installer Package by Using Microsoft Visual Studio .NETTo create a Windows Installer package by using Visual
Studio .NET, follow these steps:
- Start Microsoft Visual Studio .NET.
- On the File menu, point to
New, and then click Project.
- Under Project Types, click
Visual Basic Projects.
- Under Templates, click
Windows Application, and then click
OK.
- Add a Button control
to Form1.
- Add the following code to the
Button1_Click event handler:
MessageBox.Show("This is a test Windows Installation package") - On the Build menu, click Build
Solution.
- On the File menu, point to Add
Project, and then click New Project.
- Under Project Types, click
Setup and Deployment Projects.
- Under Templates, click
Setup Project.
- In the Name text box, type
SearchSetup, and then click
OK.
- In Solution Explorer, right-click
SearchSetup, point to Add, and then click
Project Output.
- In the Add Project Output Group dialog
box, click OK.
- In Solution Explorer, right-click
SearchSetup, and then click Build.
For additional information about how to create a setup solution for your application, click the following article number to view the article in the Microsoft Knowledge Base:
307353
HOW TO: Create a Setup Package by
Using Visual Studio. NET
back to the
topOpen the Microsoft Windows Installer (.msi) File by Using the Orca EditorTo open the SearchSetup.msi file, and then add a file search condition by using the Orca editor,
follow these steps: - Start Orca.
Note To download and then install Platform SDK (including Orca), visit the
following Microsoft Web site: After you install Platform SDK, install the Orca editor by double-clicking the
Orca.msi file. This file is located in the Bin folder that is located in the installation folder. - On the File menu, click
Open.
- In the Open dialog box, locate the
SearchSetup.msi file (located in the SearchSetup\Debug folder).
- Click the SearchSetup.msi file, and then
click Open.
back to the
topAdd New Tables to the .msi FileTo add new tables (such as the Signature table, the AppSearch table, the DrLocator table, and the LaunchCondition table) to the SearchSetup.msi file, follow these steps:
- Under Tables in the left pane, verify
whether the Signature table, the AppSearch table,
the LaunchCondition table, and the DrLocator
table exist. If these tables do not exist, go to step 2.
- On the Tables menu, click Add
Table.
- In the Add Tables dialog box, click to
select the following check boxes:
- Signature
- LaunchCondition
- AppSearch
- DrLocator
Click OK. back to the topCreate the Signature TableIn the SearchSetup.msi file, the Signature table stores information about file signatures. To create the Signature table, follow these steps:
- Under Tables in the left pane, click
Signature, and then click Add Row on the
Tables menu.
- In the Add Row dialog box, click
Signature in the Name column, and then type
ISFORMSDLL in the Signature - String[72],
Required text box.
- In the Name column, click
FileName, and then type
System.Windows.Forms.dll in the FileName -
String[255], Required text box.
- In the Add Row dialog box, click
OK.
back to the topCreate the AppSearch TableIn the SearchSetup.msi file, the AppSearch table contains the FileExists property. The FileExists property is set when the System.Windows.Forms.dll file exists on your computer. To create the AppSearch table, follow these steps:
- Under Tables in the left pane, click
AppSearch, and then click Add Row on the
Tables menu.
- In the Add Row dialog box, click
Property in the Name column, and then type
FileExists in the Property - String[72],
Required text box.
- In the Name column, click
Signature, and then type ISFORMSDLL in
the Signature - String[72], Required text box.
- In the Add Row dialog box, click
OK.
back to the topCreate the DrLocator TableIn the SearchSetup.msi file, the DrLocator table contains information about the path that the AppSearch tool must search to
locate the System.Windows.Forms.dll file. To create the DrLocator table, follow these steps:
- Under Tables in the left pane, click
DrLocator, and then click Add Row on the
Tables menu.
- In the Add Row dialog box, click
Signature in the Name column, and then type
ISFORMSDLL in the Signature - String[72],
Required text box.
- In the Name column, click
Path, and then type
Microsoft.NET\Framework\v1.0.3705
in the Path - String[255] text box.
- In the Name column, click
Depth, and then type 0 in the
Depth - Short text box.
- In the Add Row dialog box, click
OK.
back to the topCreate the LaunchCondition TableIn the SearchSetup.msi file, the LaunchCondition table contains the conditions that must be satisfied for the
installation to start. You can use the FileExists property that is located in the AppSearch table to establish the file launch condition. The file launch
condition quits the installation process when the file is not present in
the specified location. To create the LaunchCondition table, follow these steps:
- Under Tables in the left pane, click
LaunchCondition, and then click Add Row on
the Tables menu.
- In the Add Row dialog box, click
Condition in the Name column, and then type
FileExists in the Condition - String[255],
Required text box.
- In the Name column, click
Description, and then type System.Windows.Forms.dll
file does not exist. Install the file and continue. in the
Description - Localizable String[255], Required
text box.
- In the Add Row dialog box, click
OK.
- On the File menu, click
Save, and then quit Orca.
back to the topVerify That the Application Works- Locate the SearchSetup.msi file (located
in the SearchSetup\Debug folder) on your computer.
- Right-click SearchSetup.msi, and then
click Install.
If the System.Windows.Forms.dll file does not appear in the specified location on your computer, you receive the following message and the installation is not completed:System.Windows.Forms.dll
file does not exist. Install the file and continue. back to the
topREFERENCES
For additional information about the Orca Database
Editor, click the following article number to view the article in the Microsoft Knowledge Base:
255905
HOWTO: Use the Orca Database Editor to Edit Windows Installer Files
For more information, visit the following Microsoft Developer Network (MSDN) Web site: back to the
top
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbSDK kbtable kbHOWTOmaster kbhowto kbPackage kbsetup kbDeployment KB827019 kbAudDeveloper |
---|
|
|
©2004 Microsoft Corporation. All rights reserved.
|
|