Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do launch an executable from a custom strip and tile in Windows Media Center start menu?

I have added a custom strip and tile to Windows Media Center. However when I select the tile then my chosen application (notepad.exe) doesn't launch and I get the following error:

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

What do I need to change in my XML so that notepad.exe is launched rather than displaying this error message?


Further details

Using the examples provided at this blog post and this page at the Windows Dev Center, I've created the following XML file (called 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>

and the following registry file (called 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

I then install them using the following commands:

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

When I run Windows Media Center, then I can see the strip and tile - but when I select the tile then I get an error message:

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

According to this page, the entrypoint element has the attribute run which is:

A string that specifies the full or relative path to an executable file on the local computer.

What do I need to do differently with the XML file and registry key to get notepad.exe to run, rather than an error message being shown?

like image 506
Richard Avatar asked Jul 01 '17 10:07

Richard


1 Answers

The problem turns out to be twofold:

  1. Not reading the documentation correctly
  2. RegisterMceApp.exe reporting "Success" even when the XML is incorrect.

On this page which documents the entrypoint element, it quite clearly states:

<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"
    -->

My XML file used both addin and run which is why it didn't work.

The corrected version below (combined with the original registry file) will cause notepad.exe to launch when the tile is selected from within 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>
like image 81
Richard Avatar answered Nov 15 '22 22:11

Richard