Have associations for all files you install

Have associations for all files you install

Benefits

Description

Having associations for you file types is not only a Microsoft® Windows® Logo requirement; it’s an all round best practice. It’s also a good idea for you to give your users a chance to decide if they want your application to be the default handler for a specific file type.

The Microsoft Windows Installer (MSI) will handle a great deal of file registration for you – it will quite happily add your new verbs and register your application as the default handler for a specific file type. The only caveat is that, unless you tell it otherwise, MSI will assume that your program is to be the new default handler for a specific file type. Often this is not what users are looking for. They may have another preferred application or they may simply be installing your application to “try it out.” Whatever their reasons, the simple fact is that sometimes users can find it annoying that an application “takes over” a file type.

To avoid this default behavior, you could write a custom action that checks to see if the file types you’re going to add verbs for already have a default verb (or conflicting verbs). If they do, this is a situation where you need to ask the user what their preferences are. You can accomplish this with a custom, conditional dialog. Create a list box with each file type your application wants to take over. This allows the user to choose to have your application take over some file types, but not others. Based on the user’s response, you should then change which file types you register as you having the default verb. Again, you can accomplish this with a custom action, to change the MSI tables dynamically.

See Also

Roadmap to Windows Installer Documentation