RegisterMceApp.exe is not setup-friendly
I have been exploring creating MSI packages to install Media Center add-ins as part of my ongoing project to create my own Media Center add-in. During this process, I have discovered a couple of interesting behaviors of the RegisterMceApp.exe tool that we provide for add-ins to register themselves with Media Center:
- If you try to register an add-in that is already registered, RegisterMceApp.exe throws an exception and returns a non-zero value
- If you try to unregister an add-in that is already unregistered, RegisterMceApp.exe throws an exception and returns a non-zero value
These 2 facts make it somewhat complicated to launch RegisterMceApp.exe as a custom action to register an add-in using an MSI-based setup package. I talked to the developer who worked on this EXE and he provided the following suggestions that do not appear to be documented in the Media Center SDK currently:
- An MSI that calls RegisterMceApp.exe as a custom action should first call it in unregistration mode. This will ensure that any currently registered version of the add-in is removed. The custom action should be flagged to ignore the return code in case the add-in is not currently registered so that a failure to unregister will not cause setup to rollback
- An MSI should call RegisterMceApp.exe in registration mode during install and repair/reinstall, and it should obey the return code. However, it should make sure to call unregister first to avoid the exception that can be thrown if a previously registered add-in is registered again.
I realize that all of the above is fairly complicated. I am working on an example MSI package using WiX to demonstrate how to create a well-behaving Media Center add-in. Hopefully this example will demonstrate all of these concepts in a clearer way. I hope to have this example published soon (in the next week or so....)
Comments
- Anonymous
February 20, 2006
Windows XP Media Center Edition supports two types of add-ins - hosted HTML applications and Media Center... - Anonymous
March 15, 2006
Hi Aaron,
This is a great idea. We just released a simple HTML addin and used the installer to verify the end user is running windows media center, and we register the HTML addin with the installer.
Good luck!
Blueado Development Team - Anonymous
April 10, 2007
PingBack from http://www.anpark.com/index.php/2007/04/10/possible-problem-registering-media-center-applications-on-windows-vista-x64/