Redistributing MSXML 4.0


When you write applications that use MSXML 4.0 SP3, you might also need to redistribute MSXML along with your application. The two ways to redistribute MSXML with your application are:

  • Incorporate msxml4.msi into your application setup.

  • Use the .CAB file ( method of distribution for Web download installations

The following sections provide more information on steps you need to follow to use the cab method when deploying and packaging your application.

The MSXML 4.0 .cab File Redistribution Package makes it possible to distribute MSXML 4.0 through a Web download page, either on the Internet or on a private intranet. To do this, you need to create a Web page that upon opening references the file. The file then downloads the MSXML 4.0 DLLs (msxml4.dll, msxml4a.dll, and msxmldr.dll) to the user's system folder and registers MSXML 4.0 on the user's computer.

The following steps describe how to create a Web page that downloads and registers MSXML 4.0 on a user's computer.

To create a Web page that downloads MSXML 4.0

  1. Download msxmlcab.exe to your computer from the MSXML 4.0 download page at the MSDN Download Center at

  2. Run msxmlcab.exe and extract the file to a folder on your computer.

  3. Copy the file to a folder in the virtual root of your Web server.

  4. Copy the following HTML code and save it as download-msxml4.htm in the virtual root of your Web server.

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  
    <title>MSXML 4.0 SP3 Download Sample</title>  
    This page downloads MSXML 4.0 SP3...  

Note that the object element, in this example, has five attributes. The following table describes these attributes.

idIdentifies the object in the DOM. This attribute is optional.
classidUnique ID that identifies the object. This attribute is mandatory and cannot be changed.
codebaseSpecifies the path for the file and the version number. For example, if the file is located in the Objects folder of the Web site's root directory, the codebase can be changed to:


The version number can be changed if you want users to download a different version of MSXML 4.0.
typeSpecifies the type of object. This attribute cannot be changed.
styleSpecifies that the object is not displayed on the Web page. This attribute should not be changed.

To test the Web page that downloads and registers MSXML 4.0

  1. If MSXML 4.0 was previously installed on your test computer, delete the following files from your system directory:msxml4.dll, msxml4a.dll, and msxml4r.dll. The MSXML 4.0 DLLs are in the %windir%\system32 directory.

  2. Open Microsoft Internet Explorer and enter the URL of the Web page that you created to download MSXML 4.0 in step 3 of the previous procedure.

    For example, if your Web server is running on the same computer, use the following URL:


    System_CAPS_ICON_note.jpg Note

    You might need to adjust your browser settings to prevent the download of the.CAB file from being blocked by default Internet Explorer security.

  3. Click Yes in the dialog box that asks if you want to install and run the Microsoft XML Core Services.

  4. Verify that the following files are installed in the %windir%\system32 (32-bit Windows Operating System) or %windir\syswow64 (64-bit Windows Operating System) directory on your computer:

    • msxml4.dll

    • msxml4r.dll