与此问题类似的问题have been asked before但我相信Windows 8的情况已发生变化,因此不会重复。
方法1
看起来最好的windows desktop documentation表明程序使用OpenWithProgids。虽然some MSDN documentation报告此注册表项仅在Windows XP中受支持,但other documentation表示它以某种方式与Windows 8中引入的Windows应用商店一起使用。只是在我的计算机上查看,大多数程序仍然使用此注册表项,所以我打算添加它,而不是仅仅被文档混淆。
方法2
在窗口桌面文档的Application Registration部分中,将程序添加到“打开方式”上下文菜单的建议方法是使用SupportedTypes注册表项。
摘要
这两种方法都适用于Windows 7,但似乎都不适用于Windows 8。
有些人可能会建议尝试“默认程序”界面,但是,尽管这是一个好主意,documentation on it通常会指向其他位置以进入“打开方式”菜单。我通常希望应用程序能够保持“打开方式”菜单,无论它是否是当前的默认程序。
仍然保留默认程序主题,在this thread某人“偶然”进入了一个解决方案,其中将程序设置为默认值,然后将其添加到“打开方式”菜单中。遗憾的是,我的文件扩展名在我的系统上没有出现相同的行为。
<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>
答案 0 :(得分:-1)
阅读本文: https://superuser.com/questions/690106/add-items-to-the-open-with-list-in-windows-8 这在Win 8中显然是新的,但除非你提供这两个属性,否则应用程序不会出现在菜单上。