Microsoft KB Archive/185622

{|
 * width="100%"|

HOWTO: Add the MDAC Redistribution Setup to CAB Files

 * }

ID: Q185622

-

The information in this article applies to:


 * ActiveX Data Objects (ADO), versions 1.0, 1.5
 * Microsoft Active Directory Service Interfaces, versions 1.0, 2.0
 * Microsoft Data Access Components version 1.5

-

SUMMARY
When developing applications with ActiveX Data Objects (ADO) it may become necessary to distribute the Microsoft Data Access Components (MDAC). You can redistribute the MDAC run-time components via the MDAC redistribution EXE.

For Internet and Intranet environments, installing .ocx(s), .dll(s) and ActiveX document(s) require the use of CAB files. CAB files contain the components of your application and an .inf file that determines when, how and where these components install. In many cases, the CAB file references other CAB files. When distributing MDAC components you should use the Mdacfull.exe file. This file contains the MDAC redistribution setup EXE. You need the Mdacfull.exe file for this article. The file is located at the following URL:

"http://www.microsoft.com/data/downloads.htm"

MORE INFORMATION
The following information references an .ocx file that requires ADO. The .ocx is referred to as msftNexus.ocx. To add the MDAC redistribution setup (CAB) to your application's CAB file for browser installation, please follow these steps

  In order to distribute the Mdacfull.exe with your application you must CAB the EXE. You can use the Cabarc.exe utility to make your CAB file. You can find Cabarc.exe and the entire CAB SDK at the following URL: "http://www.microsoft.com/workshop/management/cab/cabdl.asp" Download the SDK and extract it into a useful directory.  Locate the directory of the Cabarc.exe. Place the Mdacfull.exe file in this directory. From the Command prompt type the following: Place the newly created Mdacfull.cab file in the download directory for your component. For example: Use the Visual Basic Setup Wizard to generate a distribution package for your application. The setup wizard generates a CAB file, which contains an .inf file and the dependent components of your application. If the Setup Wizard asks you to reference the ADO DLL (msado15.dll), clear it as a dependency. The wizard creates a \SUPPORT folder for the setup.  Locate the .inf file in the \SUPPORT folder. This file contains the dependency information for your application and determines how and where to install the components.

Under the '[Add.Code]' section of the .inf file add the line: "MDACFULL.EXE=MDACFULL.EXE." Here is an example:   Add the following code right before the [Setup Hooks] section of your .inf file:       [MDACFULL.EXE] FileVersion=4,71,0819,0 Hook=MDAC

[MDAC] file-win32-x86=http://yourwebserver/mdacfull.cab run=%EXTRACT_DIR%\Mdacfull.exe /q Be sure to change the address of the CAB file to its appropriate location. You may place the CAB in any Web directory. The /q parameter executes the setup in partial quiet mode. The user sees an extraction screen, however they are not prompted for any input.  Your .inf file should look something like the following: After editing the .inf file, you need to re-CAB your components. Although the Visual Basic Setup Wizard created a CAB file for your application, you must re-cab your components to reflect the changes in the .inf file. You can use Cabarc.exe to make your CAB file.</li>  Locate the directory of the Cabarc.exe. Add the appropriate files for the project to this directory. Create your new CAB file. From the Command prompt you would type the following: "CABARC n nameofyourcab.cab nameoftheocx.ocx nameoftheinf.inf" -or-

"CABARC n msftNexus.cab msftNexus.ocx msftNexus.inf" Be sure to include the correct, edited version of the .inf file. </li>  Place this CAB file in the directory that is referenced in the CODEBASE section of your HTML page. For example: <pre class="FIXEDTEXT">     <HTML>

<OBJECT ID="NexusCtl" WIDTH="381" HEIGHT="590" CLASSID="CLSID:FD2B0C9D-E6B9-11D1-9BE7-00C04FB9D91A" CODEBASE="msftNexus.CAB#version=1,0,0,0"> </OBJECT> -or- </li> When the browser requests this page, it attempts to install the MsftNexus.cab. It first installs Mdacfull.exe through the Mdacfull.cab and then proceeds with the rest of the dependent components. The install runs without the need for user interaction, although they will see a brief setup screen.

NOTE: Depending on the versioning of certain OLE automation components and the current services running on the target computer, the setup may require you to reboot. This reboot only occurs once. If you plan to version your components and have constantly changing GUID's, you may want to associate the MDAC install with its own GUID. This would prevent future installs and possible reboots as your component's GUID's change. This would be very effective in environments where you are creating multiple applications that are all dependent on MDAC components.</li> You must digitally sign your CAB if your users have their security set to HIGH. Otherwise, your component will not download or install. You may find more information on digital signing at the following URL:</li></ol>