Writing Registry Keys Directly
An alternative approach to registration is to bypass the registration API and write registry keys directly using a Windows Installer-based setup program. This approach is necessary when you are using a Visual Studio setup project to build your setup program.
Registry values are placed into a 32-bit or 64-bit registry, depending on the system. However, if you install an application using a 32-bit setup program on an x64-based system, the registry values are created in the 32-bit registry and the entry points to the application are not displayed in Windows Media Center. To avoid this issue, do one of the following:
- Create two versions of the setup program (32-bit and 64-bit).
- Use the RegisterMCEApp utility.
When writing registry keys directly using a Visual Studio setup project to build your setup program:
- In the Solution Explorer pane, right-click the name of your setup project, point to View, and then click Registry.
- Add the registry keys and values necessary to register your application with Windows Media Center. For an example of the registry keys you can use, see the sample registration files in [WMCSDK_InstallPath]\Samples\Register Application.
- You can also import an .reg file with the necessary keys. For example, you could register the application on a local computer using the registration API, export the registry keys and values to a .reg file, and import the registry keys and values in the .reg file onto a different computer.
- You must enter the fully-qualified path to images.
- The registry information should always be written to HKEY_LOCAL_MACHINE, which registers the application for all users.
You can verify that an entry point has been registered by using the ApplicationContext.IsEntryPointRegistered (for managed code) or MediaCenter.IsEntryPointRegistered (for hosted HTML) methods. Verification is based on the ID (GUID) for the entry point.