views:

648

answers:

2

I am upgrading an unmanaged C++ application to use the XP/Vista style common controls by adding a manifest. According to MSDN's page on application manifests, you are required to specify the name and version in the manifest, and optionally the description:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
    version="1.2.3.4"
    processorArchitecture="*"
    name="CompanyName.ApplicationName"
    type="win32"
  />
  <description>Application's description here</description>
</assembly>

How are these details used? There is a mention about backward compatibility being implied by having the same major and minor versions for assemblies, but this does not seem to apply to applications. I also haven't been able to see the name, version, or description specified by the manifest in the application's properties on Windows XP.

What effect does changing these have? Is it worthwhile to keep the version up-to-date?

A: 

For common controls to use the XP/Vista themes in a C++ application which does not link the manifest in (such as Visual C++ 6 apps), the following is a template you can use:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
 version="1.0.0.0"
 processorArchitecture="X86"
 name="Program Name"
 type="win32"
/>
<description>Description of Program</description>
<dependency>
 <dependentAssembly>
 <assemblyIdentity
   type="win32"
   name="Microsoft.Windows.Common-Controls"
   version="6.0.0.0"
   processorArchitecture="X86"
   publicKeyToken="6595b64144ccf1df"
   language="*"
 />
 </dependentAssembly>
</dependency>
</assembly>
Hernán
I've been able to find this example manifest everywhere, and you can add the manifest by hand to the resource script and VC6 will happily link it in. I'm just trying to understand the purpose to all the parts of the manifest.
Jason Owen
I don't think they do actually have a purpose. The description for example isn't currently used, and as such, never will be, due to the huge number of programs that would be described "Description of Program".
Chris Becke
A: 

I'd say its worth keeping them up to date. If for no other reason than you don't know what future tools might come along that make use of them. I'm not aware of any current uses for the assembly name, version, and so on specified in a native application's manifest. To populate the properties page on XP, you need to create a VERSIONINFO section in your resources.

Peter Ruderman