Identifying Windows Media Center Versions

From markup, you can determine which version of Windows Media Center the user is running by retrieving the MediaCenterEnvironment.Version property.

You can also detect the presence and version of Windows Media Center by looking at the following registry key:

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center

Registry value name: Ident

Registry value data type: REG_SZ

The Ident value indicates the version of Windows Media Center that is present on the computer:

Windows Media Center VersionIdent value
Windows XP Media Center Edition 2002 < 2.7
Windows XP Media Center Edition 20042.7 or 2.8
Windows XP Media Center Edition 2005 (incorporating Windows XP SP2)3.0
Update Rollup 1 for Windows XP Media Center Edition 2005 3.1
Update Rollup 2 for Windows XP Media Center Edition 2005 4.0
Windows Media Center in Windows Vista 5.0
Windows Media Center TV Pack5.1
Windows Media Center in Windows 76.0

Parsing the User-Agent Header

The User-Agent header is sent with each request sent to the web server (see section 14.43 at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This semi-colon delineated string is different depending on the application hosting environment (HTML or MCML). From an ASP or ASP.NET page, the following line of server-side code produces the User Agent string for the request, from which the necessary information can be parsed:

<%= Request.ServerVariables("HTTP_USER_AGENT") %>

When parsing the User-Agent header value, the order of items is not important and may be random.

MCML and the User-Agent Header

The User-Agent header for web applications built using MCML contains the following information:

[MCML Versions Allowed (Multiple Instances)];[MediaCenterBinariesVersion];[CpuClass]

The following are examples for Windows 7:

MCML/2006; MCML/2008; MediaCenter 6.1.7017.0; x86
MCML/2006; MCML/2008; MediaCenter 6.1.7017.0; x64

Hosted HTML and the User-Agent Header

The User-Agent header for web applications built using HTML contains a combination of Internet Explorer-based variables and Windows Media Center-specific items, as follows:

[MediaCenterIdentValue];[MediaCenterBinariesVersion]

Of these two variables, the [MediaCenterBinariesVersion] item is more important for the application developer because it is specific to the capabilities of the platform for that particular version.

The following table shows the different substrings that appear in the User Agent string for different versions of the web browser and operating system:

Operating SystemMedia Center Ident ValueWindows Media Center Shell
Windows XP Media Center Edition 2004 (incorporating Windows XP SP1)noneMediaCenter 5.1.2600.2096
Windows XP Media Center Edition 2004 (upgraded to Windows XP SP2)Media Center PC 2.8Media Center PC 2.8
MediaCenter 5.1.2600.2180
Windows XP Media Center Edition 2005 (incorporating Windows XP SP2)Media Center PC 3.0Media Center PC 3.0
MediaCenter 5.1.2700.2180
Update Rollup 2 for Windows XP Media Center Edition 2005 Media Center PC 4.0Media Center PC 4.0
MediaCenter 5.1.2710.2732
Windows Vista Ultimate, Windows Vista Home PremiumMedia Center PC 5.0Media Center PC 5.0;
MediaCenter 6.0.6001.18000
Windows Media Center TV PackMedia Center PC 5.1Media Center PC 5.1;
MediaCenter 6.1.1000.18273
Windows 7Media Center PC 6.0Media Center PC 6.0;
MediaCenter 6.1.7600.16385

The following example shows the value of the User-Agent header maintained by Windows XP Media Center Edition 2005:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Media Center PC 3.0; .NET CLR 1.0.3705; MediaCenter 5.1.2600.2180)

The following example shows the value of the User-Agent header maintained by Windows Vista:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; MediaCenter 6.0.6001.18000)

Sample Explorer

  • MediaCenterEnvironment > Version
  • Web > UserAgent String

See Also

Page view tracker