Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS
with no warranties, and confer no rights. Additionally, views expressed
herein are my own and not those of my employer, Microsoft.
As part of his series about creating a Windows Vista Media Center application, Steven Harding recently posted an item on his blog describing how to create an installer for a Media Center application. In this post, Steven walks through the process of determining what registry entries need to be created under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility, and then adding those registry values to a Visual Studio setup/deployment project.
Charlie Owen posted an item on the Media Center Sandbox blog afterwards that is essentially a response to Steven's blog post. Charlie outlines why the preferred approach for Media Center application developers is to use the RegisterMceApp utility or the RegisterApplication API within setup, and also why the samples in the SDK demonstrate how to use WiX (as opposed to the Visual Studio setup/deployment projects) to create a Media Center application setup.
I've heard questions come up fairly often on the Sandbox forum, comments on my blog and elsewhere regarding deployment options for Media Center applications, and after these 2 posts, I wanted to add a couple of comments of my own on the topic of how to register an application in a setup package so it will appear in the Media Center UI.
Options for registering a Media Center application
First, as seen in these blog posts, there are several options for registering a Media Center application within an MSI-based setup:
How to register a Media Center application in a Visual Studio setup project
If you are using Visual Studio setup/deployment projects, you will find that they do not support adding custom actions that invoke binaries not installed as part of your product. Therefore, option 2 is out (unless you know how to write scripts that invoke Windows Installer APIs to modify the MSI file after it is built as a post-build step in Visual Studio). Option 3 is fairly complicated and requires fairly in-depth knowledge about Windows Installer to get correct, so that tends to lead people to option 1.
Charlie covered this already, and I also touched on this a while back in this blog post, but I want to reiterate it again here - if you choose to write the registry values directly, you will need to ship separate MSIs for 32-bit OS's and 64-bit OS's or else your installer will not work correctly on 64-bit OS's. Not a ton of people have 64-bit OS's right now, but that number is only going to grow, and people are not happy when they cannot get an application to install and run correctly out of the box on their 64-bit OS.
WiX as an alternative to Visual Studio setup projects
When I first started looking at the steps required to create a Media Center application installer (in a series of blog posts starting with this one a while ago), I wanted to find a solution that would allow me to run RegisterMceApp directly because that file already exists on Media Center systems and it didn't make sense to me to not use it if it is already there. Because I have several years of background in Windows Installer, I naturally gravitated towards WiX as I started investigating options further because it allowed me to use declarative XML to express what I wanted my MSI to do.
There is definitely a learning curve for WiX that does not exist in graphical tools like the Visual Studio setup/deployment projects. However, that learning curve does help you better understand exactly what you are doing to the user's system in your installer, which I think allows you to design and build better installers.
In addition, the learning curve is somewhat mitigated because most Media Center application setups are fairly small and simple (I outlined the actions taken in most of these setups in this blog post). That means that once you have a template that runs the correct custom actions, checks the correct prerequisites, etc, you can fairly easily swap in your payload files and build your own MSI. That is the model I was aiming for with the sample setup files for the Q and Z applications in the Media Center SDK - both of them include fully commented WiX source (WXS) files that explain what each action does to help guide you in the right direction for creating your own setups in WiX.
I recognize now that the Q and Z examples are overly complicated for folks just getting started, which is why I'm glad to see that Charlie has posted some step-by-step instructions to make it easier to get started with this process. I'm also working with him on some ideas to make getting started with WiX for Media Center applications even easier in the future.
Why I use WiX for creating Media Center application setups
Stepping up a level and comparing Visual Studio setup projects and WiX side-by-side for the task of building Media Center application installers, I personally choose to use WiX and when people ask me why, I always mention the following reasons:
I know that WiX isn't for everyone though, but I encourage you to take a look and consider it as an option when building an MSI-based installer for your Media Center application. If you decide to try WiX and run into questions, I have posted a list of useful resources that I often refer to in this blog post.
PingBack from http://www.universityupdate.com/technology/Microsoft_Windows/3328572.aspx
Charlie from Microsoft has made a post commenting on my last blog entry - writing an installer with the
http://bathroomdesign.greatnow.com/bathroom-vanities bathroom vanities