'MCE Exposed' - Revision 05
Installing Windows XP MCE on any Windows XP flavor
return home uxtheme dlls close window

This site is for information purposes only and is not related to Microsoft in any way.
All product names mentioned here are copyrights and/or trademarks of respective companies.

Human knowledge belongs to the world.


Revision 0:
- Initial release

Revision 1 (July 12th, 2004):
- Added optional files note for xpsp2.exe rippers [DD2005]
- Cleaned up xpsp2.exe user instructions [DD2005]

Revision 2 (July 12th, 2004):
- Revised special error case for .il reassembly [DD2005]
- Added link to working .res file for users having problems [DD2005/DryRayvin]

Revision 3 (July 13th, 2004):
- Registry support INFs added! (after MCE installation, look at end) [DD2005 made me]
- Some troubleshooting advice added (look in section 3) [DD2005/DryRayvin]
- Moved Changelog to top for people to READ / re-titled history [V]
- Revised page title to reflect current revision [V]

Revision 4 (July 21th, 2004):
- Complete layout makeover [V]
- Various changes throughout [V]

Revision 5 (July 22th, 2004):
- Added skip instructions for 2005 B1 users [Mx²]

MCE History

September . 3 . 2002 - The day Microsoft Windows XP Media Center Edition was released to manufacturers in the United States and Canada. It was that day (give or take a few days) users were shocked (more like pissed off) that the software was tied to the OEM hardware and operating system software in which it ran on.

Some month . Someday . 2003/4? - A somewhat clumsy workaround was presented for getting MCE running on Windows XP Professional targets (involving registry hacks, rebooting, and time).

July . 10 . 2004 - The day this guide came out, offering users the ability to load Media Center software on their XP flavor of choice without any special tricks, PID/PK changes, etc.

Preparation for the party!

- MCE software (either CAB or ripped from XPSP2)
- A \Windows\eHome directory
- .Net Framework v1.x or v2.x plus equiv. SDK tools
(you'll just need sn.exe, msdis130.dll, and ildasm.exe if you want to grab them from a friend)

Warning! If you decide to use the files buried within' your service pack executable (xpsp2.exe), you need to ensure you grab all the required files in the other directories (such as /i386)! You can obtain a list of files required by opening /windows/inf/medctroc.inf and looking under the [SourceDisksFiles] heading. Keep in mind you will not have all of the files such as the sample DVR videos, the hi-resolution backgrounds, and the introductory/assistance videos (wmv)!

If you are installing from a Windows MCE CAB you snatched from CD2, just extract the contents into the newly created eHome directory and skip over the below instructions. If were not fortunate enough to obtain a CAB and decided to use the files within' your XPSP2 redist., gather the necessary files and dump them into a temporary folder then execute the following (from within' this directory) in a command prompt:

expand -r * C:\Windows\eHome\

After doing so, you should have a bunch of files within' your eHome directory. Look for ehShell.exe and verify that it has the pretty green-button icon. If it doesn't, stop right now as you did something wrong.

Ok, if you're using a non-MCE 2005 compilation of files, go ahead and launch mcintro.wmv (in media player classic), set it to loop, and minimize for some soothing music while you keep working. Sadly, this introductory video changed in Symphony.

It's time to do some quick integration with the operating system. Jump into the command prompt, if it's not already open, jump into the eHome\ directory and leave it open for the remainder of this guide - We'll be using it alot.

Warning! For the remainder of the guide, I will assume you have installed the SDK tools required properly (or put the files in a public directory) and set up your PATH environmental variables correctly to execute these tools without having to specify full paths - If you don't know what the heck I'm talking about, consult your nearest tuning fork.


sn -Vl

You should be greeted with "No verification entries registered". If so, your sn.exe tool is working correctly - Excellent. To prevent future strong name errors, go ahead and issue:

sn -Vr *

You should be presented "Verification entry added for assembly '*,*'". Strong-name verification will no longer occur for any .net assemblies now (could pose security issues). Now go ahead and issue the following commands (list from 2005, ignore files that do not exist):

ngen /silent /nologo ehiwmp.dll
ngen /silent /nologo ehiExtens.dll
ngen /silent /nologo ehRecObj.dll
ngen /silent /nologo ehCIR.dll
ngen /silent /nologo ehepgdat.dll
ngen /silent /nologo ehiEPG.dll
ngen /silent /nologo ehiPlay.dll
ngen /silent /nologo ehiProxy.dll
ngen /silent /nologo ehiTuner.dll
ngen /silent /nologo ehiuserxp.dll
ngen /silent /nologo ehiVidCtl.dll
ngen /silent /nologo ehepg.dll
ngen /silent /nologo EhCM.dll
ngen /silent /nologo ehcommon.dll
ngen /silent /nologo bdatunepia.dll

Let's now register some needed assembly types by issuing the following commands:

regasm ehRecObj.dll
regasm ehCIR.dll
regasm ehepgdat.dll
regasm ehepg.dll

Almost done, let's finish up by registering some libraries and codecs by issuing the following commands (ignoring files that you do not have):

regsvr32 /s sbe.dll
regsvr32 /s quartz.dll
regsvr32 /s encdec.dll
regsvr32 /s VBICodec.ax
regsvr32 /s WSTPager.ax
regsvr32 /s WSTRenderer.ax
regsvr32 /s Mpeg2Data.ax
regsvr32 /s msvidctl.dll
regsvr32 /s bdaplgin.ax
regsvr32 /s msdvbnp.ax
regsvr32 /s PsisDecd.dll
regsvr32 /s Psisrndr.ax
regsvr32 /s qdvd.dll

Ok we're pretty much done with the half-assed installation of MCE. I won't go further into what needs to be present/running for MCE to work - That's for a later time.

Oh no, we're not on Windows XP MCE!
Warning! Microsoft Windows MCE 2005 Beta 1 users should not have to do his as oddly enough the protection does not exist! Skip to the warning box above Crashes, errors, and bears - Oh my!

If the above actually worked for you (thank god), you should be able to execute ehshell.exe and receive this wonderful error (may differ between versions): "Media Center only works on Windows XP Media Center Edition." Whoo hoo! We wasted our time right? Wrong. Let's find out where it's checking the OS we're on, and 'fix' it.

This error message is obviously coming from somewhere, but where? Keep in mind English is not the only language in the world, therefore all the strings used within' this application are likely localized. Looking around, you should find a ehres.dll file that contains all the resources used within' MCE. Opening it with your favorite resource editor, you'll find STRINGS.XML (within' the file) contains localized strings. Go ahead and search for our error string - You'll find it with an ID of StartupError.NotFreestylePID. Jot this down, we'll need it later.

Ok put your thinking cap on - Let's see... we run ehshell.exe, it does some magic on our PID, and loads this localized error from ehres.dll. Ok so obviously the PID check is within' ehshell.exe or something it accesses. Let's fire up ildasm.exe and drag ehshell.exe onto the window. Go to File > Dump and in the options dialog that appears afterwards make sure only 'Dump IL Code' and 'Expand try/catch' checkboxes are checked. Click ok and save the resulting IL file in a separate directory (resources will fall out hence the new directory) and call it ehshell.il. It should be a whopping 20-30MB depending on what version of MCE we're working with here. Open this file in a proper editor such as UltraEdit, or if you're brave and have enough RAM, in Wordpad (jEdit rox). Find the first instance of our annoying StartupError.NotFreestylePID. You should come to something that looks somewhat like:

IL_0015: starg.s id
IL_0017: ldc.i4.s 87
IL_0019: call int32 [EhCM]eHome.Native.Win32::GetSystemMetrics(int32)
IL_001e: brtrue.s IL_002d

IL_0020: ldc.i4.1
IL_0021: stloc.0
IL_0022: ldstr "#StartupError.NotFreestylePID"
IL_0027: starg.s id
IL_0029: br.s IL_002d

As you can see from this IL code, the function GetSystemMetrics() is called (from user32.dll) with an argument of 87 - What the heck is 87 you ask?

Look at the documentation on this function. You'll see the function takes in an argument and spits out a return value. In this case, 87 (the value of constant SM_MEDIACENTER) is passed in. The function returns and I quote: "Nonzero if the current operating system is the Windows XP, Media Center Edition, zero if not.". I whipped up some sample implementation code for you to play with, if you become bored.

Ok, so now knowing this, here's our same IL dump with comments:

IL_0015: starg.s id
IL_0017: ldc.i4.s 87 < SM_MEDIACENTER
IL_0019: call int32 [EhCM]eHome.Native.Win32::GetSystemMetrics(int32)
^ Call GetSystemMetrics(SM_MEDIACENTER)

IL_001e: brtrue.s IL_002d
^ Did we get a boolean value of True back? If so jump over error code.

IL_0020: ldc.i4.1
IL_0021: stloc.0
IL_0022: ldstr "#StartupError.NotFreestylePID"
IL_0027: starg.s id
IL_0029: br.s IL_002d

Although we could get efficient and entirely skip over this check regardless of OS, let's just get this over with and reverse the check (MCE OS users will get the error now). Using your text editor, change:

IL_001e: brtrue.s IL_002d

... to read:

IL_001e: brfalse.s IL_002d

Now save the bugger and close your editor to free precious memory. Did you close your command prompt? Hope not. Browse to where you saved the IL code (and it's attached res file) and now execute:

ilasm /resource:ehshell.res /exe ehshell.il

Warning! If you received "File cannot be found" or "Could not create output file" errors at the end of your compilation, delete your .res file and replace it with mine.

Ok now you SHOULD have your new, patched executable with the purty icon sitting in your IL dump directory. Go ahead and replace the ehshell.exe in your eHome\ directory with this one. You're done with the patching.

Warning! To fix some interface issues (with EhiProxy/EPG/etc.) and to generally Make Things Better (tm), execute install.bat within' the registry support archive. Executing uninstall.bat will wipe the registry entries, should you decide to remove MCE from your system.
Crashes, errors and bears - Oh my!

Current troubleshooting advice/notes:

System.Runtime.InteropServices.COMException (0x80040155): Interface not registered
^ Currently being investigated

System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 8, position 1.
^Currently being investigated (wierdness with recording XML files (located in C:\Documents and Settings\All Users\Application Data\Microsoft\eHome\Recording))

System.InvalidCastException: Specified cast is not valid.
at ehiProxy.ResourceMgrClass.GetEhepgdatDispatcher(EhepgdatDispatcher& ppEhepgdatDisp)
^ Currently being investigated - Did you try the INFs above yet?

[ insert app/feature here ] crashes!
^ Can you be more specific?

If MCE is still crashing (and you've merged in my new registry entries above), you should have an event log in the "Media Center" category within' your Event Log viewer. If you don't, or it doesn't provide useful information, you can dig into ehshell.crash in the same directory as the executable. Send this information to me and I'll look into it.

Plugs n' Credits

+ Thanks to an anonymous chap that provided Media Center 2005 for testing (much more stable than 2004!), and thanks to my primary testers DD2K5 and DryRayvin.

+ Shouts go to Iexbeta for a friendly forum, Winbeta for being stupid, Betas for harboring the world's biggest newbies, Neowin for having an immensely shitty portal, and TheGreenButton for implementing a forum search feature that let me search for some valuable hardware requirement information.


xhtml 1.1 valid // css valid