How to properly add file associations to the Windows Registry?

What data and where, should I add to the Windows registry to properly create a file association?

I ask this question primarily because of some old applications that I wrote years ago, which used Visual Studio .NET's Windows Installer packager to create the file associations. The extensions I installed were .whr and .encxml.

Now, on the computer on which these applications are installed, a strange problem occurs sometimes - when a file is downloaded in either Google Chrome or Internet Explorer (especially an exe, msi or zip file), the browser will change the file extension to one of the extensions that was installed by my installer. I don't know if it affects other browsers - do those two have anything in common? So... if you download, for example,, the file will be downloaded as (or .whr, whichever one it picks for the moment) for no apparent reason whatsoever.

I should note that the keys that the HKCR\.whr and HCKR\.encxml keys reference (Account Manager Encrypted XML File and Work Hours Record) have spaces in them, and when I created the association in Visual Studio, I did NOT add a "." to the front. Perhaps spaces are not allowed, and/or you're supposed to prefix with "."? The registry code seems OK, but I noticed by looking through my registry that every other application does NOT use a space in the association class, nor does this issue happen with ANY other file extension from any application installed on any machines I know of - only the ones created by my applications' VS installers. I've pasted a registry dump of the corresponding registry keys and values related to the file extensions - since MSI is proprietary I have no idea if this is all of it, but from what I know from other applications this should be everything. I've always wondered about this issue for years, but could never figure it out. I am replacing one of those old applications with a newer product soon, so this time I want to make sure there are no odd bugs like this...

Here's the data (note that I've indicated the text values of some binary strings with a // comment below the value):

"Content Type"="application/octet-stream"
@="Account Manager Encrypted XML File"

[HKEY_CLASSES_ROOT\.encxml\Account Manager Encrypted XML File]

[HKEY_CLASSES_ROOT\.encxml\Account Manager Encrypted XML File\ShellNew]

[HKEY_CLASSES_ROOT\Account Manager Encrypted XML File]
@="Account Manager Encrypted XML File"

[HKEY_CLASSES_ROOT\Account Manager Encrypted XML File\DefaultIcon]

// Product code GUID is: {F7F214E9-ED37-4AE1-B0D2-93427973E60A}, which is different from below but I probably changed it at some point for some reason
// %APPDATA%\Microsoft\Installer\{B641760B-7DB7-4F1B-AD6E-0A3420F5EE0D}\_6FEFF9B68218417F98F549.exe,0

[HKEY_CLASSES_ROOT\Account Manager Encrypted XML File\shell]

[HKEY_CLASSES_ROOT\Account Manager Encrypted XML File\shell\open]

[HKEY_CLASSES_ROOT\Account Manager Encrypted XML File\shell\open\command]
@="\"C:\\Program Files\\Petroules Enterprises\\Account Manager\\AccountManager.exe\" \"%1\""

// This is a bizarre-looking value... what's up with that?
// L)%Ycsg-LA(0df46u_P'>'}'f%oYdKiHtz5!U+lhT "%1"

"Content Type"="application/octet-stream"
@="Work Hours Record"

[HKEY_CLASSES_ROOT\.whr\Work Hours Record]

[HKEY_CLASSES_ROOT\.whr\Work Hours Record\ShellNew]

[HKEY_CLASSES_ROOT\Work Hours Record]
@="Work Hours Record"

[HKEY_CLASSES_ROOT\Work Hours Record\DefaultIcon]

// Product code GUID: {FA23D764-F649-48F9-8D0B-E1885A981F99}, same as below
// %APPDATA%\Microsoft\Installer\{FA23D764-F649-48F9-8D0B-E1885A981F99}\_6FEFF9B68218417F98F549.exe,0

[HKEY_CLASSES_ROOT\Work Hours Record\shell]

[HKEY_CLASSES_ROOT\Work Hours Record\shell\open]

[HKEY_CLASSES_ROOT\Work Hours Record\shell\open\command]
@="\"C:\\Program Files\\Petroules Enterprises\\Work Hours Calculator\\WorkHoursCalculator.exe\" \"%1\""

// Same bizarre-looking type of value as before, but different...
// (]VIyU{^N?&hH~S$n16Y>3u_}G&pyux8NrCng'DgB "%1"


In Windows Installer we use the RegisterExtensionInfo standard action:

Which uses principally uses the Extension and Verb tables along with some joins to COM related tables: ( Extension Table ) ( Verb Table )

Need Your Help

Linux task in the background finishes

linux command-line command uibackgroundtask

I have got a Linux task that finishes and prints:

ASP.NET and HTML pages - some advice needed from Search Engine perspective html seo

I have a bunch of aspx ( and html pages. The site is active past 2 years and gets decent traffic. Now all this while, I have not taken care of SEO. So my pages do not have meta tags, descri...