Creating a Manifest for Your Application

NoteNote

It is recommended that you upgrade to MSXML 6.0, because it provides security and performance improvements over earlier MSXML versions. If you must use MSXML 4.0 in your application, upgrade to the latest service pack for MSXML 4.0.

If you want to use side-by-side installation to deploy applications that use MSXML 4.0 to computers running Windows XP and Windows Server 2003, you must create an application manifest and deploy it with your application.

The application manifest is an XML file that:

  • Uniquely identifies the application.

  • Describes dependencies on specific versions of side-by-side assemblies.

NoteNote

MSXML 4.0 is the only MSXML version that supports Windows side-by-side installation.

For example, if your application depends upon the RTM version of MSXML 4.0, write your application manifest so it uses the RTM version of MSXML 4.0 installed in the Windows global store. The following procedure describes how to create a manifest for this purpose.

To create a manifest for your application

  1. Copy this sample manifest and paste it into any text editor.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity
        version=""
        processorArchitecture=""
        name=""
        type=""
    />
    <description></description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.MSXML2"
                version=""
                processorArchitecture="X86"
                publicKeyToken=""
                language="*"
            />
        </dependentAssembly>
    </dependency>
    </assembly>
    
  2. After you have pasted the sample code above, you must update it as appropriate for your application. To do this, change the featured values (those in bold in the sample code) of the first <assemblyIdentity> element as follows:

    1. For the version attribute, set the value to the current version number for your component or application. This number is specified in the properties for your project when it is built using Microsoft® Visual Studio.

    2. For the processorArchitecture attribute, only change the value of the processor architecture if you are deploying to a processor architecture that is not Intel-x86 compatible. Otherwise, use the suggested default.

    3. For the name attribute, set the value to the registered name for your application. For most Windows applications, you only need to replace "mysampleapp" with the base name of the executable (.exe) file containing your application.

    4. For the type attribute, only change the value if you are deploying to a version of Windows that does not run under the Win32 API. Otherwise, use the suggested default.

  3. Update the description for your application.

    The <description> element is optional, so you can either update its contents to include a brief description of your application or remove it from your manifest code. If you choose to remove it, be sure to remove both its opening and closing tags and any character data contained within them.

  4. For the dependent assembly section, update the featured attribute values for the <assemblyIdentity> element so that its values are appropriate to your version of MSXML.

    For the version and tokenKey attributes, verify that the values match those used in the assembly manifest that is provided for MSXML 4.0 when it installs under Windows in side-by-side mode. Assembly manifests are located in the special WinSxS/Manifest directory. For example, the assembly manifest file for MSXML 4.0 is called msxml4.manifest.

  5. Save the application manifest to file in the same directory as the executable file for your application.

    Name your manifest file so that it has the same name as your application, and add the ".manifest" extension to the end of it. For example, if your application executable is called test.exe, the manifest file should be named test.exe.manifest.

  6. Decide how to package and deploy your application manifest with your application.

    As an alternative for new applications, you can include the application manifest directly in the header file for your application. In this case, also add the following line to the header file:

    CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""
    

    Be sure you update "YourApp.exe.manifest" with the name for your manifest file. After you add the line above to your application header file, the manifest will be directly included with your application binary file the next time it is compiled.

    If you do not choose to include the manifest in this way, include the manifest file separately in the Windows Installer package (.msi) you create to install your application.

    NoteNote

    If you provide your manifest both separately and internally in the resource section of your compiled executable, the file system version of your manifest always takes precedence over the one included with the executable file.

  7. Test your application to ensure that you get the results you want.

    Testing your application before deployment is always important, but you should be sure that your test computer does not already have MSXML 6.0 registered on it. Otherwise, your testing will be compromised and the results will be incorrect.

  8. Deploy or update your application as a Windows Installer package.

Show: