How to: Add a Launch Condition for Microsoft Data Access Components
Any Visual Basic or Visual C# application that includes data access has a dependency on Microsoft Data Access Components (MDAC) version 2.8 or later. MDAC must be installed on a target computer prior to installing your application or the application will fail.
MDAC is already installed on most operating systems except for Windows 2000 Service Pack 3 or earlier. The same procedure described in this topic can be used to check for the correct version of any dependent component.
For any application that has a dependency on a component such as MDAC, you can to add a launch condition to the application's deployment project that checks for the correct version of the component and, if not found, halts the installation and warns the user.
An alternative to adding a launch condition is to use the bootstrapper to install prerequisite components on the target computer. For more information, see How to: Install Prerequisites in Windows Installer Deployment.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.
To add a launch condition for MDAC
Select the deployment project in Solution Explorer. On the View menu, point to Editor, and then click Launch Conditions.
Select the Requirements on Target Machine node. On the Action menu, choose Add Registry Launch Condition.
Select the Search for RegistryEntry1 node. In the Properties window, select the RegKey property and enter Software\Microsoft\DataAccess.
Select the Root property and enter vsdrrHKLM.
Select the Value property and enter FullInstallVer.
Select the Property property and enter MDACSEARCH.
In the Launch Conditions Editor, select the Condition1 node. In the Properties window, select the Condition property and enter MDACSEARCH>="2.8".
Select the Message property and enter MDAC version 2.8 or higher must be installed prior to installing this application. You can install MDAC from the Microsoft Web site http://www.microsoft.com.
You may want to modify this text for your particular situation — for example, you could point to a network share where MDAC is located.