My adventure creating a Media Center add-in, part 3

I’m going to shift course a little bit from my previous entry regarding creating a Media Center add-in.  For one thing, I still haven’t had enough time to sit down and really dig into the code of the example add-ins that are installed as part of the Media Center SDK.  For another, I have had a couple of folks ask me more in-depth technical questions about how to install an add-in and what exactly comprises the payload of an add-in setup package.  So I set out tonight trying to figure out the deployment part of creating a Media Center add-in.

Based on my previous research, I knew that the contents of an add-in are basically a .NET assembly, an XML registration file that you pass into the application RegisterMCEApp.exe that ships in the %windir%\ehome directory as part of Media Center 2005, and any additional files (like bitmaps or data files) that the add-in might require.  I had previously looked at an add-in written by Ethan Zoller, and the “setup” for his add-in was a simple batch file that copied the assembly to %windir%\ehome, called RegisterMCEApp.exe, and xcopied a few other files it needed to %windir%\ehome or a subdirectory.

This seemed straightforward enough, but being the setup geek that I am, I’m not a big fan of installations that use batch files and don’t give the user a clearly defined, robust uninstall and transactional installation process.  So I sought out better recommendations in the SDK documentation for creating a real setup package for installing and uninstalling add-ins.  I found this page with a few links that describe how to perform various deployment related tasks:

There is not really any other information in MSDN about deploying Media Center add-ins that I could find, but I suppose this is not too surprising considering that the installation process itself is fairly simple.  Unfortunately, these docs assume the average add-in writer has a copy of Visual Studio .NET 2002 or 2003 and a good working knowledge of the Visual Studio setup/deployment project type.  The good news is that the SDK ships a custom action DLL that can be consumed to run code that is the equivalent of RegisterMCEApp.exe during an MSI-based add-in setup process.  I wonder why this registration has to be done with a black-box executable instead of just by creating some registry keys that Media Center knows how to read.  I know I said when I started this add-in project that I was going to approach it as someone who did not have access to all of the Microsoft internal employee resources, so I will have to answer that question for myself with some side research some other time.

OK this is all I have time for tonight.  I know this didn’t really advance my ultimate goal of creating an add-in, but this research did fill in some background knowledge I’m going to need down the road, and it started me thinking about whether or not there are any ways to make the deployment of add-ins easier for customers.

Next time I’ll look into some of the sample add-in code, I promise…

[to be continued]


Comments (5)

  1. RickG says:

    I’d really like to see more on this. I’m interested in creating plug-ins myself. Just downloaded the SDK.

  2. Martin says:

    I’ve been struggling like mad to create an MSI installer for a media center add in. I don’t have Visual Studio 2002, only Visual Studio Express 2005 (Beta), so I am using WiX to create the installer. The big problem that I have is I just can’t work out how to use the RegisterAddIn.dll file in the installer to register the add in. In the end, the only way I could register it was to ship RegisterMCEApp in my installer and run that. The lines in WiX to do that are;

    <File Id=’regExe’ Name=’REGIST~1.EXE’ LongName=’RegisterMCEApp.exe’ DiskId=’1′ src=’C:Program FilesMicrosoftMicrosoft Windows XP Media Center SDKSample AddInsRegisterAddInRegisterMCEApp.exe’ />

    <CustomAction Id=’RegisteringAddIn.install.SetProperty’ FileKey=’regExe’ ExeCommand=’ /allusers "[MyDir]ReadNews.xml"’ Return=’check’/>

    <CustomAction Id=’RegisteringAddIn.uninstall.unSetProperty’ FileKey=’regExe’ ExeCommand=’ /u /allusers "[MyDir]ReadNews.xml"’ Return=’ignore’/>


    <Custom Action=’RegisteringAddIn.install.SetProperty’ After=’InstallFinalize’>NOT Installed</Custom>

    <Custom Action=’RegisteringAddIn.uninstall.unSetProperty’ Before=’UnpublishComponents’>Installed</Custom>


    Now, I know this sucks. It’s really not what is intended, but I just can’t get anything else to work. Have you got any great ideas about what I need to write to get this to work using the DLL?



  3. astebner says:

    Hi Martin – you read my mind! I was intending to try to make a simple WiX-based add-in setup package that could be used instead of the Visual Studio-based instructions listed at as one of my next steps. I need to do a little more research into some of the WiX authoring concepts, but I hope to have something like this working very soon. Stay tuned….

  4. Martin says:

    I found this web site which is a pretty good intorduction to WiX;


  5. As part of his series about creating a Windows Vista Media Center application, Steven Harding recently