Similar questions to this one have been asked before but I believe that things have changed with Windows 8 so that this is not a duplicate.
Method 1
What looks like the best windows desktop documentation suggests that a program uses OpenWithProgids. Although some MSDN documentation reports this registry key is only supported in Windows XP, other documentation indicates it is somehow used with the Windows Store, introduced with Windows 8. Just looking on my computer, most programs still use this registry key, so I plan to add it rather than only be confused by the documentation.
Method 2
In the Application Registration section of the window desktop documentation the suggested method for adding a program to the “Open With” context menu is using a SupportedTypes registry key.
Summary
Both methods work on Windows 7, but neither seems to be working on Windows 8.
Some may suggest trying out the “Default Programs” interface but, although it’s a good idea anyway, the documentation on it generally points you elsewhere for getting on the “Open With” menu. I would generally expect an application to be and stay on the “Open With” menu regardless of whether it is currently the default program.
Still, staying on the Default Programs topic, in this thread someone “stumbled” into a solution where setting a program as the default once added it to the “Open With” menu. I unfortunately do not get the same behavior on my system, with my file extensions.
<Component Id="ConsoleApplication" Guid="*">
<File Id="ConsoleApplication.exe" Name='ConsoleApplication.exe' DiskId='1'
Source='$(var.ConsoleApplication.TargetDir)/ConsoleApplication.exe'
KeyPath='yes' />
<!-- ProgID (always required) -->
<RegistryValue Root="HKLM"
Key="SOFTWARE\Classes\ConsoleApplication.MyProgId"
Name="FriendlyTypeName"
Value="ConsoleApplication ProgID"
Type="string" />
<ProgId Id="ConsoleApplication.MyProgId"
Description="ConsoleApplication MyProgId"
Advertise="yes">
<Extension Id="xyz">
<Verb Id="open"
Command="Open"
Argument=""%1""/>
</Extension>
</ProgId>
<!-- Method 1: Add to the "Open With" menu using a ProgID -->
<RegistryValue Root="HKLM"
Key="SOFTWARE\Classes\.xyz\OpenWithProgids"
Name="ConsoleApplication.MyProgId"
Value=""
Type="string" />
<!-- Method 2: Add to the "Open With" menu using "Application Registration" -->
<RegistryValue Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConsoleApplication.exe"
Value="[!ConsoleApplication.exe]"
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConsoleApplication.exe"
Name="Path"
Value="[INSTALLFOLDER]"
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\Classes\Applications\ConsoleApplication.exe\SupportedTypes"
Name=".xyz"
Value=""
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\Classes\Applications\ConsoleApplication.exe\shell\open"
Name="FriendlyAppName"
Value="My FriendlyAppName"
Type="string" />
<!-- "Default Programs" registration -->
<RegistryValue Root="HKLM"
Key="SOFTWARE\ConsoleApplication\Capabilities"
Name="ApplicationDescription"
Value="Console application."
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\ConsoleApplication\Capabilities"
Name="ApplicationIcon"
Value="[INSTALLFOLDER]ConsoleApplication.exe,0"
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\ConsoleApplication\Capabilities"
Name="ApplicationName"
Value="ConsoleApplication"
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\ConsoleApplication\Capabilities\DefaultIcon"
Value="[INSTALLFOLDER]ConsoleApplication.exe,0"
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\ConsoleApplication\Capabilities\FileAssociations"
Name=".xyz"
Value="ConsoleApplication.MyProgId"
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\ConsoleApplication\Capabilities\shell\open\command"
Value=""[INSTALLFOLDER]ConsoleApplication.exe" "%1""
Type="string" />
<RegistryValue Root="HKLM"
Key="SOFTWARE\RegisteredApplications"
Name="ConsoleApplication"
Value="SOFTWARE\ConsoleApplication\Capabilities"
Type="string" />
</Component>