HOW TO: Obtain the COM Registration Information in a Windows Installer Package by Using Microsoft Visual Studio .NET (827017)
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
SUMMARYThis step-by-step article discusses how to obtain
the COM registration information in a Microsoft Windows Installer package by using Microsoft Visual
Studio .NET. You set registry launch conditions in your Visual Studio .NET
Setup project to determine if the COM component is registered. If you set
registry launch conditions, AppSearch searches the registry for the COM
registration, and then returns the search results as a property while installing the
package. If the registry entry does not exist on your computer, the launch condition uses this property to quit the installation
process. In the
sample, you create a Visual Studio .NET Setup project. In this project, you set the registry launch condition to search for the registry entry of the Mscorlib.dll file on your computer. If the Mscorlib.dll file is not registered on your computer, the launch
condition quits the installation of the Windows Installation
package. 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
This article assumes that you are familiar with the
following topics: - Visual Studio .NET Setup Projects
- Launch Conditions
back to the
topCreate a Setup ProjectTo create a Setup project 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
Setup and Deployment Projects.
- Under Templates, click
Setup Project.
- In the Name text box, type
MyApp, and then click OK.
back to the topAdd a Windows Application to the Setup ProjectTo add a Windows Application project to the Setup project, follow these steps:
- On the File menu, point to Add
Project, and then click New Project.
- Under Project Types, click
Visual Basic Projects.
- Under Templates, click
Windows Application.
- In the Name text box, type
MyWindowsApp, and then click
OK.
- Add a Button control
to Form1. By default, Button1 is
created.
- Add the following code to the Button1_Click event handler:
MessageBox.Show("This is a test Windows Application") - In Solution Explorer, right-click
MyWindowsApp, and then click
Build.
- In Solution Explorer, right-click MyApp,
point to Add, and then click Project
Output.
- In the Add Project Output Group dialog
box, click OK.
back to the topAdd a Registry Launch Condition to the Setup ProjectTo add a registry launch condition that searches for the
registry entry of the Mscorlib.dll file based on the registry key that you provide in the Setup project,
follow these steps:
- In Solution Explorer, right-click MyApp,
point to View, and then click Launch
Conditions.
- In the Launch Conditions Editor, right-click
Requirements on Target Machine, and then click Add
Registry Launch Condition.
- Right-click Search for RegistryEntry1, and
then click Properties Window.
- In the Properties window, verify if
the Root property is set to
vsdrrHKLM.
- Set the RegKey property to
the following:
SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\9CD7C0343CB3E804297298BEA362A56C - Set the Value property to
the following:
AA75334BD6A349D45BE6344CD4905E84 - Right-click Condition1, and then click
Properties Window.
- In the Properties window, set the
Condition property to the following:
- Set the Message property to the following:
Mscorlib.dll is not registered. Register the component to continue. - In Solution Explorer, right-click MyApp,
and then click Build.
back to the topVerify That Your Application Works- Locate the MyApp.msi file in the MyApp\Debug folder on your computer.
- Right-click MyApp.msi, and then click
Install.
- If the Mscorlib.dll file is not registered on your computer, you receive the following message and the installation process is not completed:Mscorlib.dll is not registered. Register the component to continue.
back to the
topREFERENCES For additional
information, click the following article number to view the article in the
Microsoft Knowledge Base: 307374
HOW TO: Use Launch Conditions in Visual Studio .NET
For more information, visit the following
Microsoft Developer Network (MSDN) Web site: back to the
top
Modification Type: | Minor | Last Reviewed: | 5/23/2005 |
---|
Keywords: | kbHOWTOmaster kbhowto kbRegistry kbsetup kbDeployment KB827017 kbAudDeveloper |
---|
|
|
©2004 Microsoft Corporation. All rights reserved.
|
|