如何从Windows Media Center开始菜单中的自定义条带和磁贴启动可执行文件?

时间:2017-07-01 10:38:57

标签: windows windows-media-center

我已将自定义条带和磁贴添加到Windows Media Center。但是当我选择磁贴时,我选择的应用程序(notepad.exe)没有启动,我收到以下错误:

  

[name]程序已停止响应,您将会   返回Windows Media Center。

我需要在XML中更改哪些内容才能启动notepad.exe而不是显示此错误消息?

更多细节

使用Windows开发人员中心提供的示例at this blog postthis page,我创建了以下XML文件(称为dummy.xml):

<application title="appTitle" id="{81E3517C-A5F3-4afa-9E37-81BF9A6A99FE}">
    <entrypoint id="{760A3CF3-6675-444b-AA31-B2A3F94AD9A3}"
        addin="Microsoft.MediaCenter.Hosting.WebAddIn,Microsoft.MediaCenter"
        title="entrypointTitle"
        description="Description"
        run="notepad.exe">
        <category category="MyCompany\MyApplication1"/>
    </entrypoint>  
</application>

和以下注册表文件(称为dummy.reg):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Start Menu\Applications\{81E3517C-A5F3-4afa-9E37-81BF9A6A99FE}]
"Title"="appTitle"
"Category"="MyCompany\\MyApplication1"
"OnStartMenu"="True"
"TimeStamp"=dword:0c7e59de

然后我使用以下命令安装它们:

%windir%\ehome\registermceapp.exe dummy.xml
regedit.exe /s dummy.reg

当我运行Windows Media Center时,我可以看到条带和磁贴 - 但是当我选择磁贴时,我收到一条错误消息:

The [tile name] program has stopped responding and you will be returned to Windows Media Center.

根据this pageentrypoint元素的属性run为:

  

一个字符串,它指定本地计算机上可执行文件的完整路径或相对路径。

我需要做什么不同的XML文件和注册表项才能运行notepad.exe,而不是显示错误消息?

1 个答案:

答案 0 :(得分:1)

问题结果是双重的:

  1. 未正确阅读文档
  2. RegisterMceApp.exe报告&#34;成功&#34;即使XML不正确。
  3. 在记录entrypoint元素的this page上,它清楚地说明了:

    <entrypoint
        id="entry point GUID"
    
        <!-- This element can have only one of the following attributes:
        addin="AssemblyInfo"
        url="URL of entry-point page"
        run="path of EXE file"
        -->
    

    我的XML文件同时使用addinrun,这就是为什么它没有用。

    从Windows Media Center中选择磁贴后,下面的更正版本(与原始注册表文件结合使用)将导致notepad.exe启动:

    <application title="appTitle" id="{81E3517C-A5F3-4afa-9E37-81BF9A6A99FE}">
        <entrypoint id="{760A3CF3-6675-444b-AA31-B2A3F94AD9A3}"
            run="notepad.exe"
            title="entrypointTitle"
            description="Description">
            <category category="MyCompany\MyApplication1"/>
        </entrypoint>  
     </application>