11

我已向 Windows Media Center 添加了自定义条带和磁贴。但是,当我选择磁贴时,我选择的应用程序 ( notepad.exe) 不会启动,并且出现以下错误:

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

我需要在我的 XML 中更改什么以便 notepad.exe启动而不是显示此错误消息?


更多详细信息

使用此博客文章和Windows 开发中心的此页面中提供的示例,我创建了以下 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 时,我可以看到条带和磁贴 - 但是当我选择磁贴时,我收到一条错误消息:

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

根据此页面,该entrypoint元素具有以下属性run

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

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

4

1 回答 1

1

问题原来是双重的:

  1. 没有正确阅读文档
  2. RegisterMceApp.exe即使 XML 不正确,也会报告“成功”。

在记录元素的这个页面entrypoint上,它非常清楚地指出:

<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这就是它不起作用的原因。

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

<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>
于 2017-08-05T18:21:23.443 回答