Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support


Go Back   Australian Media Center Community > Windows Media Center Plugins & Addons > Windows Media Center Plugins & Addons

Community Information

Launching games from MCE
this thread has 54 replies and has been viewed 26979 times
Reply
 
Thread Tools
Old 1st December 2005, 10:37 PM   #1 (permalink)
MC Graduate
 
nickoz's Avatar
Status nickoz is Offline:
Location Australia
ActivityPosts: 51
Reputation & Thanks Support Rating:
nickoz
Points Earned: 29

nickoz has been thanked 0 times in 0 posts
Post Launching games from MCE

Well, Im just playing around trying to find a decent way to launch games from the MCE interface.. I'm simply too lazy to close MCE and click on an icon.. anyway, here's my first attempt after a little research, for anyone who's interested;

Steps:
1. Open the Start Menu\Programs\Accessories\Media Center\Media Center Programs folder under your Documents and Settings directory
2. Create a .MCL file with the name of your game, eg. Call of Duty 2.mcl
3. Copy the following into it;

<application
name = "My Game"
SharedViewport = ""
NowPlayingDirective = ""
run = "My Game.lnk"
>
<capabilitiesrequired
directx="True"
audio="False"
video="False"
intensiverendering="True"
console="False"
cdburning="False" />
</application>

3. Replace the name="" with whatever you want displayed in MCE
4. Replace the run="" with the full path/filename of the SHORTCUT you use to launch your game with. If you use the exe directly, its current directory will be C:\windows\ehome, and obviously it wont run properly.

OK, so when you go to My Programs from MCE, you'll see an icon for your game there. Launch it, any running media will stop and the game (should) load. The only problem now, is getting MCE to reappear once the game has closed. Apparently you can use some code to get it back (http://msdn.microsoft.com/library/de...Developers.asp) but I cant see anyway to do it without writing a prog that launches the game and, when done, reinstates MCE.

So.. thats my first go at getting a game to launch directly from MCE, I hope it helps someone out there. If anyone has anything else to add or any ideas on this problem I'd love to hear em. Let the games begin.

Cheers,
Nick.
  Reply With Quote
Old 13th January 2006, 01:42 PM   #2 (permalink)
MC Graduate
 
Mark^Bastard's Avatar
Status Mark^Bastard is Offline:
ActivityPosts: 76
Reputation & Thanks Support Rating:
Mark^Bastard
Points Earned: 11

Mark^Bastard has been thanked 0 times in 0 posts
Re: Launching games from MCE

This is interesting. I'd like to take it one step further and be able to do the following.

* Have a 'My Games' menu with game cover art etc.
* Be able to use the MCE remote to perform some operations, like for example the 'record' button should save your progress in the game. Basically you should be able to map MCE remote buttons to keyboard commands.
* Have categories for the games, even be able to use emulators that can take command line arguments etc.

I realise the MAME frontend exists but it doesn't tie in with MCE enough (both look and functionality) for my liking. A 'My Movies' style plugin for games would be so much better.
  Reply With Quote
Old 9th February 2006, 03:22 AM   #3 (permalink)
MC Apprentice
 
stonebullet's Avatar
Status stonebullet is Offline:
ActivityPosts: 11
Reputation & Thanks Support Rating:
stonebullet
Points Earned: 10

stonebullet has been thanked 0 times in 0 posts
Re: Launching games from MCE

Quote:
Originally Posted by Mark^Bastard
This is interesting. I'd like to take it one step further and be able to do the following.

* Have a 'My Games' menu with game cover art etc.
* Be able to use the MCE remote to perform some operations, like for example the 'record' button should save your progress in the game. Basically you should be able to map MCE remote buttons to keyboard commands.
* Have categories for the games, even be able to use emulators that can take command line arguments etc.

I realise the MAME frontend exists but it doesn't tie in with MCE enough (both look and functionality) for my liking. A 'My Movies' style plugin for games would be so much better.
Me too. There is a certain other front end that does it just fine, so why not M$?
__________________
Well, that's another fine post you have made there. Maybe next time you'll pick a subject that you actually know something about....
  Reply With Quote
Old 10th April 2006, 01:21 AM   #4 (permalink)
MC Graduate
 
nickoz's Avatar
Status nickoz is Offline:
Location Australia
ActivityPosts: 51
Reputation & Thanks Support Rating:
nickoz
Points Earned: 29

nickoz has been thanked 0 times in 0 posts
Re: Launching games from MCE

For people who tried out the MCL approach to starting games from MCE, but are having problems getting MCE to restore after the game has finished, here is a small loader app (and source code) that will do the trick. All you have to do is call 'GameLoader.exe <full path to app exe>' to start the game, and when its done the loader will reinstate the MCE interface for you.

To use it, all I did was create the MCL file as mentioned in the first post, but then modify the game shortcut that is referenced by the 'run' statement, and appended 'GameLoader' to the start of the target within that shortcut (go to the properties for the .lnk file and edit the target). eg;

C:\WINDOWS\GameLoader.exe "C:\Program Files\Electronic Arts\The Godfather The Game\godfather.exe"

Note: The source code and executable are provided as-is with no warranty. It can be reused, modified and redistributed in any way without permission. All source code was written and compiled in VS2003 to run on Windows XP.

Nick.
Attached Files
File Type: zip GameLoader-src.zip (18.8 KB, 223 views)
File Type: zip GameLoader-bin.zip (23.6 KB, 336 views)
  Reply With Quote
Old 10th April 2006, 04:33 AM   #5 (permalink)
MC Apprentice
 
amos_82's Avatar
Status amos_82 is Offline:
ActivityPosts: 44
Reputation & Thanks Support Rating:
amos_82
Points Earned: 27

amos_82 has been thanked 2 times in 2 posts
Re: Launching games from MCE

Great work Nick!

The loader works perfectly. Thanks for showing us how to setup the games in Mce its brilliant!
  Reply With Quote
Old 10th April 2006, 12:48 PM   #6 (permalink)
MC Graduate
 
nickoz's Avatar
Status nickoz is Offline:
Location Australia
ActivityPosts: 51
Reputation & Thanks Support Rating:
nickoz
Points Earned: 29

nickoz has been thanked 0 times in 0 posts
Re: Launching games from MCE

No probs amos, glad to hear she works okay
I did notice however that when LiveTV was running and you start a game, in some cases the TV kept playing away in the background while the game was running - made for some interesting sound effects mid-game

Happy gaming folks,
Nick.
  Reply With Quote
Old 10th April 2006, 01:56 PM   #7 (permalink)
Tak
MC Specialist
 
Tak's Avatar
Status Tak is Offline:
Location Sydney
ActivityPosts: 254
Reputation & Thanks Support Rating:
Tak
Points Earned: 63

Tak has been thanked 14 times in 12 posts
Tak's
Media Center
Re: Launching games from MCE

Thanks Nick,

This is great stuff. Haven't used it as yet, but I'm sure it opens up endless possibilities!

Have just used something similar to access streming radio from the MCE menu and it's so much better than reaching for the keyboard.

Cheers,

Tak
__________________
My setup is here:
http://www.xpmediacentre.com.au/community/members/tak
  Reply With Quote
Old 11th April 2006, 03:55 AM   #8 (permalink)
MC Apprentice
 
amos_82's Avatar
Status amos_82 is Offline:
ActivityPosts: 44
Reputation & Thanks Support Rating:
amos_82
Points Earned: 27

amos_82 has been thanked 2 times in 2 posts
Re: Launching games from MCE

Good News!

Thanks to Nick's GameLauncher & a little batch file, we can now close MCE when a game launches & start MCE when it closes!

Heres an example of the batch file:

@echo off
start "" "C:\WINDOWS\GameLoader.exe" "C:\GAMES\Mortal Kombat 4\MK4.EXE"
taskkill.exe /F /IM ehshell.exe


How to set it up:
1. Open notepad
2. Copy & paste the example above.
3. Change the location of the game to match the one you want to run. (Leave the 'gameloader' part untouched)
4. Save the text document as .bat instead of .txt (in the same directory as the game's exe file) If your version of Windows has a "Save as type" option, choose "All files", otherwise it will save as a text file.
5. Create a SHORTCUT to the .bat file, (rename it if you want) then add the shortcut's location to the .mcl file (instructions at beginning of post).

You MUST have downloaded the GameLauncher & extracted it into your C:\WINDOWS directory! (it only works from that location)

(By the way, if you want to run a trainer, or something else with the game; add another 'start line' (after the echo line) and type the full path to the extra item).

All credit to Nick, your a legend

Last edited by amos_82; 11th April 2006 at 05:13 AM..
  Reply With Quote
Old 11th April 2006, 01:38 PM   #9 (permalink)
MC Graduate
 
nickoz's Avatar
Status nickoz is Offline:
Location Australia
ActivityPosts: 51
Reputation & Thanks Support Rating:
nickoz
Points Earned: 29

nickoz has been thanked 0 times in 0 posts
Re: Launching games from MCE

Thats a good idea amos, nice work. Give me a couple of days and I'll (hopefully) extend the GameLoader code to do a little more work -


1/ Add a command line switch to gracefully shutdown MCE, something like:

Code:
GameLoader.exe [-k] <full path to app exe> [app command line]
Where -k will close the MCE interface (if running), giving it a chance to execute shutdown code. Killtask terminates the MCE process without warning it, so things like codecs and memory allocations may not get cleaned up. In my case, I'm using ffdshow and NVIDA PureVideo which both have icons in the system tray when running. If you kill the MCE process using killtask, those icons stay around, indicating they havent been detached by MCE smoothly.

2/ Add the MCELauncher code to GameLoader. This code basically creates the Direct3D context correctly before the game loads. In the MSDN doco linked above it explains how games need correct timing to ensure the context is created AFTER MCE has closed its own context - if they dont, it can cause the game to crash during initialization. You will only get this in some cases depending on your system spec and other factors, but will improve reliability when using the GameLoader.

Nick.
  Reply With Quote
Old 11th April 2006, 09:54 PM   #10 (permalink)
MC Graduate
 
nickoz's Avatar
Status nickoz is Offline:
Location Australia
ActivityPosts: 51
Reputation & Thanks Support Rating:
nickoz
Points Earned: 29

nickoz has been thanked 0 times in 0 posts
Re: Launching games from MCE

Oh well.. I got bored today, so I fixed the app. Now it does everything mentioned above, with the syntax given (make sure you use the correct order, '-k' (which is optional of course) BEFORE the exe path, otherwise it will be passed to the game instead).

Oh, and the exe is now less than half the size

Bona' petit.
Nick.
Attached Files
File Type: zip GameLoader-1.0.1.zip (30.8 KB, 325 views)
  Reply With Quote
Old 11th April 2006, 11:51 PM   #11 (permalink)
MC Apprentice
 
amos_82's Avatar
Status amos_82 is Offline:
ActivityPosts: 44
Reputation & Thanks Support Rating:
amos_82
Points Earned: 27

amos_82 has been thanked 2 times in 2 posts
Re: Launching games from MCE

Nice one Nick,
i was a bit worried about killing the ehshell.exe like that, looks like it will do the trick.

The only thing is i cant get it running Ive downloaded the new gameloader and extracted it to the windows directory as before, but i cant get it to work; MCE minimises and returns as it was a second later.

I tried double clicking on the GameLoader.exe to check the syntax & got this error report:

GameLoader.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
Error Signiture:
AppName: gameloader.exe AppVer: 1.0.1.153 ModName: gameloader.exe
ModVer: 1.0.1.153 Offset: 00001326

Maybe im using the wrong syntax? Heres an example from one of my shortcuts:

C:\WINDOWS\GameLoader.exe [-k] "N:\Games\EA Sports Rugby 06\Rugby06.exe"

Any ideas?

Amos
  Reply With Quote
Old 12th April 2006, 01:19 AM   #12 (permalink)
MC Graduate
 
nickoz's Avatar
Status nickoz is Offline:
Location Australia
ActivityPosts: 51
Reputation & Thanks Support Rating:
nickoz
Points Earned: 29

nickoz has been thanked 0 times in 0 posts
Re: Launching games from MCE

Sorry, my bad I've fixed that crash when you run it without any parameters. But the problem you've got is with the [-k], the square brackets are just a way of saying the -k is optional, don't actually include them in the statement. Use:

Code:
 C:\WINDOWS\GameLoader.exe -k "N:\Games\EA Sports Rugby 06\Rugby06.exe"
So, if you want to close MCE before launching AND verify the DX9 device, do:

Code:
C:\WINDOWS\GameLoad.exe -k -d "N:\Games\EA Sports Rugby 06\Rugby06.exe"
Don't close MCE, but verify the DX9 device:

Code:
C:\WINDOWS\GameLoad.exe -d "N:\Games\EA Sports Rugby 06\Rugby06.exe"
and obviously, just -k if you only want to close MCE before launching. The DX9 tests can actually cause problems with games that dont need it, so only use it if you're experiencing problems with a certain game loading up.
Cheers
Nick.
Attached Files
File Type: zip GameLoader-1.0.2.zip (31.0 KB, 498 views)
  Reply With Quote
Reply

Bookmarks

Thread Tools



Advertisers












Terms Of Service - Contact Us - Advertise With Us - Archive - Privacy Policy - FAQ
Microsoft©, Windows 7©, Windows Vista© & Windows XP© are registered trademarks of Microsoft Corporation.
www.xpmediacentre.com.au has no relationship with, nor is affiliated in any way with Microsoft Corporation.
All original content on this website © 2004 - 2010 xpmediacentre.com.au, All rights reserved
Forum by vBulletin Version 3.8.3 - Copyright Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
Local time now is 08:52 AM AEDT.

Add to Google