Recently, I was helping a friend test an installer for a Windows Vista Media Center application and ran across an interesting issue that I wanted to post here so that other Media Center application developers will think about it when designing their own setups as well.
The installer I was testing included entries in the Registry table of the MSI to create registry values to register the application so it would appear in the Media Center UI. This algorithm is described at http://msdn2.microsoft.com/en-us/library/bb189827.aspx in the Windows Vista Media Center SDK documentation.
When I installed this MSI on my x64 Windows Vista Ultimate Edition system and then launched Media Center, I could not find any entry points to use to start the application. I investigated further by looking around in my system registry using regedit.exe, and I found that all of the Media Center registration information was created in the following location:
Because the MSI I installed was a 32-bit MSI, Windows Installer automatically creates registry values in the 32-bit registry instead of the 64-bit registry. However, since Media Center runs as a native 64-bit application on Windows Vista x64, it only knows to look in the 64-bit registry for extensibility application registration information. As a result, I did not see any entry points to this application in the Media Center UI even after installing the MSI.
In order to avoid this issue, I recommend using a custom action that calls RegisterMceApp.exe instead of writing the registration registry values directly. You can see examples that demonstrate how to create a custom action like this using WiX by looking at the Q and Z sample applications in the Windows Media Center SDK for Windows Vista. The files q.wxs and z.wxs contain fully commented WiX setup source code that describes what each action is designed to do.
I also wrote more detailed blog posts describing the Q sample application setup at this location for WiX v2.0 and this location for WiX v3.0 that are useful to look at in order to get a deeper understanding about how Windows Media Center application setups should be constructed.
If you prefer to not use WiX to build your setup, the only other reliable alternative I know that will allow you to avoid this 64-bit installation issue is to create separate installers for 32-bit and 64-bit operating systems. In this option, you can create the 32-bit installer the same way as before. However, you must make the following changes in the 64-bit installer in order for it to create the Media Center registration registry values in the correct location:
- Mark the MSI with an attribute in the Template Summary property of the summary information stream to indicate that it is an x64 MSI
- Mark the components that install the Media Center registration registry values as 64-bit components by setting the msidbComponentAttributes64bit in the Attributes column of the Component table
Links to additional information
You can check out the following links for more information about 64-bit-specific issues related to Windows Installer:
- About Windows Installer on 64-bit operating systems - http://msdn2.microsoft.com/en-us/library/aa367451.aspx
- Using 64-bit Windows Installer packages - http://msdn2.microsoft.com/en-us/library/aa372396.aspx
You can also check out the following links for more information about how WOW64 works in Windows:
- Registry reflection- http://msdn2.microsoft.com/en-us/library/aa384235.aspx
- Registry redirection for application developers - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/registry_redirector.asp
- Accessing an alternate registry view - http://msdn2.microsoft.com/en-us/library/aa384129.aspx
- Example code for registry reflection and redirection on WOW64 - http://msdn2.microsoft.com/en-us/library/aa384182.aspx