Launch a program from W7MC main menu

mrsilver

Posts: 63
Joined: Mon Oct 20, 2014 5:01 pm
Location:

HTPC Specs: Show details

#21

Post by mrsilver » Sun Aug 06, 2017 1:29 pm

So the good news is that I have it working! :D

It turns out that I'd misread the (not very good) Microsoft documentation, my XML was wrong and there was nothing to indicate the case. Basically, I'd use both "addin" and "run" and you can only have one. The correct code is as follows:

BigBox.xml

Code: Select all

<application title="Gaming" id="{81E3517C-A5F3-4afa-9E37-81BF9A6A99FE}">
    <entrypoint id="{760A3CF3-6675-444b-AA31-B2A3F94AD9A3}"
      title="LaunchBox"
      description="Game launcher"
      imageURL = ".\BigBox.png"
      run="c:\windows\system32\notepad.exe">
      <category category="MyCompany\MyApplication1"/>
    </entrypoint>
</application>
You can change the path to BigBox or any program you like (it'll currently fire up notepad) and I'm pretty sure it'll work. There are two caveats:
  1. When it closes, W7MC won't be maximised again.
  2. If W7MC comes to the foreground and active (eg. you've pressed the home button), then whatever you called will continue to run in the background (and continue to make sounds).
You can work around #1 by pressing the home button and #2 can be carefully avoided - but I'm in the process of writing an executable which will handle both of these points and has the added advantage of allowing you to configure it to launch other executables without requiring a need to learn to code.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#22

Post by jachin99 » Tue Aug 22, 2017 4:35 pm

Thanks for sharing. I'm looking at how to add additional tiles to existing strips right now but I've only been successful at adding them to the extras menu. What folder do you store your .xml and image files in? I have mine in program data I think

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#23

Post by jachin99 » Thu Aug 24, 2017 3:18 pm

After toying around with the start menu for a few days, I have successfully added a new strip to my start menu, and placed new tiles under the Radio strip under presets. Here is my documentation, and a template.

Code: Select all

<application  Title="MediaCenterSports" id="{6736229D-0B8A-4668-BA0B-F983C4CDB36}" companyName="Jachin99" description="Updated Sports Experience" StartMenuStripCategory="Sports" StartMenuStripTitle="MediaCenterSports">
  <entrypoint id="{8BD1723B-34CF-4DC0-9250-5E63EB1F2F74}"
              title="On TV"
              description="take notes"
              imageURL="locationofimage"
              run="File location">
	<category category="Jachin99\MediaCenterSports" order="1"/>		
  </entrypoint>
    <entrypoint id="{9B09049C-9DE0-4917-B5FF-02A9FE18EF9}"
              title="Scores and News"
              description="take more notes"
              imageURL="imageLocation"
              run="filelocation">
    <category category="Jachin99\MediaCenterSports" order="2"/>
  </entrypoint>
</application>

<!--Use this as a general template.  TAKEN FROM: https://msdn.microsoft.com/en-us/library/windows/desktop/aa468274.aspx
<application id="{5D97995E-4722-4f21-B3B6-4C6916DEB871}"
             Title="Application Title"
             Description="Application Description"
             CompanyName="Application Company Name"
             StartMenuStripTitle="Start Menu Title"
             StartMenuStripCategory="Custom Start Menu\Application1">
</application>
    TITLE:Required string that specifies the title of the application
	ID:Required string in the form of a GUID, should be different than GUID for entrypoint element
	COMPANYNAME:Optional string that specifies the company that authored app
	DESCRIPTION:Optional string that describes app
	STARTMENUSTRIPCATEGORY:Name for the custom start menu category associated with app
	STARTMENUSTRIPCATEGORY:Name for the custom start menu strip associated with app
<capabilitiesRequired
    directX="{true | false}"
    audio="{true | false}"
    video="{true | false}"
    intensiveRendering="{true | false}"
    console="{true | false}"
    cdBurning="{true | false}">
</capabilitiesRequired>
	DIRECTXVIDEO:Optional, True if directx support is required, false if not
	AUDIO:Optional, Indicates if audio support is required
	VIDEO:Optional, indicates whether app requires video support
	INTENSIVERENDERING:Optional, True indicates application contains graphics that require high end rendering
	CONSOLE:Optional, indicates indicates whether app requires resources that are only available or meaningful from hostPC rather than remote session.  Example includes LCD projector app that turns the projector on and off through com port.
	CDBURNING:Optional, indicates whether app requires cd, or dvd burner
<category
    category="Windows Media Center category"
    order="Tile order in the custom Start menu strip">
</category>
	CATEGORY:Required string that identifies the WMC integration location for an application entry point see remarks for valid category strings
	ORDER:Optional string that defines the order of the tiles in the start strip.  Only applicable if custom start menu strip has been dfined in the application element.
	REMARKS:
	Category strings                    Location
	Internet Radio						Music > Radio > Sources
	Internet Radio\Presets				Music > Radio > Presets
	More Programs						Extras > Extras Library
	Custom Start Menu                   Application-specific custom Start Menu strip
	More With This\Audio\Album          Music > Music Library > Albums > select an album, then right-click or press MORE INFO > More…|| Music > Music Library > Years > select an album, then right-click or press MORE INFO > More… ||Music > Music Library > Album Artists > select an album, then right-click or press MORE INFO > More…
	
	More With This\Audio\Artist
	Music > Music Library > Artists > select an artist, then right-click or press MORE INFO > More… ||Music > Music Library > Composers > select an artist, then right-click or press MORE INFO > More…
	More With This\Audio\Playlist       Music > Music Library > Playlists > select a playlist, then right-click or press MORE INFO > More… 
	More With This\Audio\Song           Music > Music Library > Songs > select a song, then right-click or press MORE INFO > More…
	More With This\Audio\Genre          Music > Music Library > Genres > select a genre, then right-click or press MORE INFO > More…
	More With This\DVD                  Movies > Play DVD > select a movie and right-click > More… || Movies > Movie Library > select a movie and right-click > More…
	More With This\Picture              Pictures + Videos > Picture Library > select a picture, then right-click or press MORE INFO > More…
	More With This\Video                Pictures + Videos > Video Library > select a video, then right-click or press MORE INFO > More…
	AutoPlay\Blu-ray					--------------------------
	AutoPlay\HD DVD                     --------------------------
	Background                          --------------------------
	OEM Extensibility 1                 --------------------------
Note   The Services\* and Settings\* strings have been deprecated, although they are still valid to support previous versions.
<entrypoint id="{B4A74AD0-3BE2-43d8-A738-82398887FAA6}"
    addin="Microsoft.MediaCenter.Hosting.WebAddIn,Microsoft.MediaCenter"
    title="Start Menu Tile Title"
    description="Start Menu Tile Description"
    imageURL="ImageFocus.png"
    inactiveImageURL="ImageNonFocus.png"
    context="http://mywebsite/Default.mcml">
</entrypoint>
Defines an entry point into an application designed to be used within Windows Media Center. This element is a child of the application element.
ID:GUID string that shoud be different from the GUID created for the application element
ADDIN:A comma separated string that defines the attributes of a managed code assembly.  For WMC app (Local or background) the string is in the following format: 

	"className,assemblyName,Version=version,PublicKeyToken=publicKey,Culture=culture"
	
	where:

		className is the full name (assembly and class) of the application's implementation of a class that inherits from the IAddInModule interface.

		assemblyName is the name of the application's assembly.
	
		version is the version number of the application's assembly.

		publicKey is the public portion of the cryptographic key used to sign the application's assembly. Use the Strong Name tool (sn.exe) with the -p option to extract the public portion of the cryptographic key from your .snk file. For more information, see Strong Name Tool (Sn.exe) on the MSDN web site.

		culture is the cultural designation of the application's assembly.

		The version, publicKey, and culture values must be an exact match with the strong-name information stored in the application's assembly. For more information, see Creating a Strong-Named Assembly.

		For a Windows Media Center web application, this attribute must be "Microsoft.MediaCenter.Hosting.WebAddIn,Microsoft.MediaCenter". 
URL:String that specifies the path to an entry point page in the application, value must contain "http://"
RUN:String specifying full or relative path of executable
TITLE:Required string that identifies the entry point in the WMC UI and contains a short summary of the entry  point (for example, New Releases").  It appears at the top of the Extras Library page then the entry point is selected
NOW PLAYING DIRECTIVE:Optional string that sets the state of the currently playing media/Now Playing view item(NowPlaying element in MCML) when the entry point is launched.  Whenever possible, an application should set thse values from code, script, or MCML.  Choose the following values:
	
	VALUE          DESCRIPTION
	close          The shared view port/Now Playing experience is closed.
	pause          Media is paused
	stop           Media is stopped
	mute           Media is muted
DESCRIPTION:Optional string the describes the purpose of the entry point to provide additional information to the user(for example the latest tracks from this artist)
IMAGEURL:Optional string that specifies path to PNG format image displayed in WMC UI.  Application image is 186 by186 pixel png bitmap with support for alpha transparency.  WMC automatically and proportinally scales image as appropriate if you d not specify an image, a WMC generic image or the title of the application is used instead.  While its possible for the same image to be used for many entry points, its recommended to use a custom image for each entry point.
INACTIVEIMAGEURL:Optional string that defines which image is used when tile is not in focus, grayscale image is used.
CONTEXT:Optional. An application-defined string that Windows Media Center provides to the application when the entry point is selected. This can be an arbitrary set of parameters for the application. For a Windows Media Center web application, this attribute is set to the HTTP URL of the application
UIFLAGS: Optional. A comma-delimited string used to affect certain Windows Media Center UI features. The only option is "HideTransportToolbar", which hides the mouse transport controls (this toolbar is located in the lower-right corner of the Windows Media Center UI, which appears when the user moves the mouse, includes buttons to perform actions such as pausing, stopping, and rewinding.
ACCEPTWEBINVOKE:if true it can be launced from a web application. 
</application>
-->



jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#24

Post by jachin99 » Thu Aug 24, 2017 4:03 pm

Forgot to add, you will need to add some files to the registry as well. The registration files will get your tile listed under the extras options menu but that's it. The GUIDs in these registry keys need to match those in your registration files. If there is enough interest in this, I will document it a little better. I also have a complete template if someone can host the file or I can host it on the site. Here is a registry key template

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Start Menu\Applications\{6736229D-0B8A-4668-BA0B-F983C4CDB363}]
"Title"="MediaCenterSports"
"Category"="Jachin99\\MediaCenterSports"
"OnStartMenu"="True"
"TimeStamp"=dword:0cc919b0

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\Jachin99\MediaCenterSports\{8BD1723B-34CF-4DC0-9250-5E63EB1F2F74}]
"TimeStamp"=dword:0CC919AF

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\Jachin99\MediaCenterSports\{9B09049C-9DE0-4917-B5FF-02A9FE18EF92}]
"TimeStamp"=dword:0CC919B0

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#25

Post by jachin99 » Tue Aug 29, 2017 8:28 pm

This method isn't working for me on a machine which has media center studio installed on it. I'm guessing media center studio takes ownership or changes permissions on key files that registermceapp uses to make changes. I went as far as to download the MSVS 2008, and the WMC SDK for WIn 7, and I couldn't even get the stock registration example files to change my start menu on the machine.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#26

Post by jachin99 » Fri Sep 01, 2017 7:00 pm

Here are more details about the method mrsliver used to create a start menu entry point for windows media center. https://blogs.msdn.microsoft.com/astebn ... ia-center/

scott_lampe

Posts: 2
Joined: Fri Sep 01, 2017 10:26 pm
Location:

HTPC Specs: Show details

#27

Post by scott_lampe » Fri Sep 01, 2017 10:31 pm

"Mce reset toolbox" is what I used to use to get mce looking/doing exactly what you want. It has been a while since I used it but it was very good.

Sent from my SM-N920F using Tapatalk

mrsilver

Posts: 63
Joined: Mon Oct 20, 2014 5:01 pm
Location:

HTPC Specs: Show details

#28

Post by mrsilver » Sun Sep 17, 2017 9:22 am

Sorry for the delayed response, even though I'm subscribed to the thread I didn't get any notifications of new posts.

Sounds like you got everything working! Nice one. I've partially written a launcher app to handle the opening and closing of an executable but real life has prevented me from finishing it off.

Regarding MCE Reset Toolbox, does that still work with the current version of W7MC? I notice that you cannot register it any more as the author and website have disappeared.

Slinkynose

Posts: 11
Joined: Thu May 22, 2014 9:39 pm
Location:

HTPC Specs: Show details

#29

Post by Slinkynose » Thu Sep 21, 2017 6:29 pm

MCE Reset Toolbox still works for me, though I had it registered before it went offline. I like and use many of the tools it has in combination with other tools like MyChannel Logos.

The Menu editing features still work to some extent, but I have been getting strange behavior when I make changes now. I'm sure it is my fault, but it has become frustrating since that was the easiest way to get fully custom menus.

My most recent bizarre experience was with OpenPHT for Plex. When I transitioned to EPG123 I had to wipe out my WMC configuration and start from scratch. No matter what I did I was unable to get OpenPHT to set up the shortcut in WMC. I ended up using MCEReset Toolbox to get the shortcut back, but it will only work if I put it under the TV bar. When I try to make a new bar, WMC crashes on launch.

I intend to play with some of the methods you have described here to see if I can get my menus to look exactly like I want.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#30

Post by jachin99 » Thu Sep 21, 2017 8:39 pm

The best advice I can give you is download the WMC SDK VERSION 6 (the download from microsoft is version 5.3, which is meant for Vista but still works) and make a copy of the registration example. From there edit your copy, and use that.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#31

Post by jachin99 » Wed Sep 27, 2017 1:19 pm

Yet another method for modifying the start menu. http://hack7mc.blogspot.com/2009/03/rem ... strip.html Whats weird is that up to this piont, I believed that the start menu lived in markup.dll but maybe its split among different dlls, or I was wrong entirely.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#32

Post by jachin99 » Tue Oct 17, 2017 6:49 pm

Here is more about registering a link file with WMC, and adding it to the main menu. The program can run on its own, and then return to WMC when you are through with it.

https://blogs.msdn.microsoft.com/astebn ... ia-center/

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#33

Post by jachin99 » Sat Dec 02, 2017 1:58 am

I'm at the beginning of modifying my start menu using only registermceapp.exe, registration files, and batch scripts. I'm using WMC command line arguments to start applications via their GUIDs within a batch file. I have most of it working but my problem is that when I click on a tile in my newly created strip, I get an error message saying unable to launch application, but then the application launches. Has anyone else ran into this problem or know of a solution?

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#34

Post by jachin99 » Sat Dec 02, 2017 4:24 am

I figured this out without using batch files, and my errors went away. Instead of using run, I looked up the assemby info in the registry for the applications I was trying to move, and used the addin attribute. Now I don't get any errors and everything launches

User avatar
DavidinCT

Posts: 1556
Joined: Mon Feb 13, 2012 3:45 pm
Location:

HTPC Specs: Show details

#35

Post by DavidinCT » Mon Dec 04, 2017 5:32 pm

jachin99 wrote:I figured this out without using batch files, and my errors went away. Instead of using run, I looked up the assemby info in the registry for the applications I was trying to move, and used the addin attribute. Now I don't get any errors and everything launches
about 5 years ago, I went through the same process, figuring out how to add a program to the start menu with it's settings. I found it way easier just to deal with the scripts on ReLanuch and using a front end (MCE reset tool or Media center studio) to move it.

It was nice to learn but, it's old now..
-Dave
Twitter @TheCoolDave

Windows Media Center certified and WMC MVP 2010 - 2012

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#36

Post by jachin99 » Mon Dec 04, 2017 5:54 pm

The nice thing about registering your own is that you don't have to install any third party software. MCERSTB, and MCS are both flawed in their own ways while registering my own applications is something that works every time I use it, and doesn't require me any fixes to be constantly updated. If I ever want to change anything or I decide i don't like my new menu strips then I can run a simple command and put WMC back exactly how it was before.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#37

Post by jachin99 » Wed Dec 06, 2017 4:34 pm

From the old hack7MC blog posting located here: http://hack7mc.blogspot.com/2009/03/rem ... trips.html

This method also enables “per user” disabling of menu strips through the current user’s registry values. Alternatively, editing the local machine values will set the default visibility of strips for all users. This hack was originally posted to Mikinhosoft with details on the registry values to edit. For simplicity we’ll just edit a .reg file to add the values to the registry. First download this registry file with the all the entries for each of the start menu strips (excluding Movies). Next open the file in notepad to edit the values of each entry. Inside you will find an entry for each menu strip, excluding Movies, which has an “OnStartMenu” value. By default each menu strip’s “OnStartMenu” value is set to true.

For each entry you will see an “@” value with the name of each strip, which is only used to identify the strip, changing this doesn’t change anything inside Media Center. Change the “OnStartMenu” value to “False” for any strip you don’t want to appear in your media center start menu. To reverse the change simply change the value back to “True”. If you’d rather set the default strips for all users change each “HKEY_CURRENT_USER” to “HKEY_LOCAL_MACHINE”. Changing all of these values to local machine will set the default start menu strips across all user accounts. After you’ve completed editing the .reg file save and then double-click to add the values into your registry. When prompted, allow the registry entries to be updated. This proves to be a much easier method to edit your start menu strips in Media Center. Again, thanks to Mikinhosoft for posting this information and creating the registry file for this hack.

This is a registry change that does about the same thing as HideMenuStrips for WMC. When the download link dies I have the .reg file referenced above.

Post Reply