WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Vista Games Explorer and Media Center
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

Vista Games Explorer and Media Center

Hello all!

I've written a plug-in to aid in registering a game with Vista's new Games explorer as well as the Games section of Windows Media Center. I've already uploaded and documented it on the URL submitted by user., so now I'm just letting you guys know about it.

If anybody wants to help me out, the one thing I can't test is whether the game gets registered properly with Media Center on a 64-bit version of Windows with a 32-bit installer. Any reports are appreciated!

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 05-09-2007 01:33 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

Working url: http://nsis.sourceforge.net/Games_plug-in

Looks good, there was a thread about the game explorer already, but it was using the system dll. A plugin for something is always helpful

One little thing, I thought the official way to restore mediacenter was to run %systemroot%\eHome\ehShell.exe and not looking for its window

__________________
IntOp $PostCount $PostCount + 1

Last edited by Anders on 05-09-2007 at 02:07 AM

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 05-09-2007 01:39 AM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

Yep, I know about the other thread you're talking about. I originally started working with that code, but I wanted it to load the information directly from the embedded GDF instead of having to specify it twice, and after a while of trying to do that with the system dll I realized that it was getting ridiculous and made much more sense to do it as a plug-in.

I've also read the ehShell.exe approach you're talking about. For reference, it's documented here: URL submitted by user.

Note to anybody reading that code: IsMediaCenter() doesn't actually exist. They don't actually say this, but they want you to write that function yourself and use your own method for figuring out whether or not the game was launched from Media Center.

I could have gotten away with launching ehShell.exe at exit when I wrote MCEWrapper, but originally I tested my code directly in one of our games, and the advantage with the method I used is that it works even when you don't know when your game was launched from Media Center, so that's what I would suggest if you were building it directly into your game.

I found that approach from this blog post by Aaron Stebner, the Program Manager of Windows Media Center: URL submitted by user.

Hopefully he knows what he's talking about. (Not that I have the greatest opinion about how Media Center was written...)

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 05-09-2007 02:12 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

The findwindow approach is only slightly better, media center could be running but that doesnt mean your game was started from MCE. Putting MCE code in your app is silly anyway, but if you had to do it, you could pass some argument to the game to tell if it was started from MCE. For MCEWrapper it doesnt really matter what you do I guess. And I agree about MCE, it could be so much better than it is now

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 05-09-2007 02:49 AM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

I agree with everything you said >:)

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 05-09-2007 02:52 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

After some testing on Windows XP, it seems the FindWindow method doesn't return Media Center to fullscreen mode.

I've uploaded and new version that fixes that as well as other XP-related bugs, and reduced the footprint a little. I've also updated the Wiki page accordingly.

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 05-10-2007 07:58 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

In my MCE controller app, I do SNDMSG(hMCE,WM_SYSCOMMAND,SC_MAXIMIZE,0); seems to work on XP, not really tested on Vista

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 05-10-2007 08:29 AM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

That looks like it would work, but wouldn't it maximize Media Center after you've exited your game, even if you had it in window mode beforehand?

Granted, that would be a relatively minor gripe, since Media Center is intended to be used in fullscreen mode.

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 05-10-2007 08:38 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

Yeah, I don't have the code in front of me right now, Im probably checking for WS_MAXIMIZE style or something like that to decide what message to send

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 05-10-2007 03:36 PM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
Comm@nder21
Major Dude

Registered: Jul 2003
From: germany, b-w

the dll failes loading on my vista business installation while it just exits with error code 0, like documented, on xp pro sp2.

what's wrong with it?

nsis can't load the dll on runtime on vista, it says.

__________________
hand by comm@nder21
----------
WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility

Quick Link | Report this post to a moderator | IP: Logged

Comm@nder21 is offline Old Post 06-03-2007 07:58 PM
Click Here to See the Profile for Comm@nder21 Click here to Send Comm@nder21 a Private Message Click Here to Email Comm@nder21 Visit Comm@nder21's homepage! Find more posts by Comm@nder21 Add Comm@nder21 to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

The DLL posted on the Wiki depends on MSVCR80.dll. It should be recompiled statically, or better yet, without the CRT.

__________________
NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 06-04-2007 05:35 AM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
Comm@nder21
Major Dude

Registered: Jul 2003
From: germany, b-w

static recompilation gave me a 120kb file.

thats ok for me, because it doesn't really matter in an 13mb game installer.

yet it should of course not waste that much space if unnecessary.

i would appreciate any optimization on this one.



also, though i now got it running, it failes on registering my game.

i have a valid GDF file, but the error message is "could not add or update game"

skrapion, you got any hint on what may be wrong?

__________________
hand by comm@nder21
----------
WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility

Quick Link | Report this post to a moderator | IP: Logged

Comm@nder21 is offline Old Post 06-04-2007 02:58 PM
Click Here to See the Profile for Comm@nder21 Click here to Send Comm@nder21 a Private Message Click Here to Email Comm@nder21 Visit Comm@nder21's homepage! Find more posts by Comm@nder21 Add Comm@nder21 to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

Most likely it means you already registered the game on that machine, and then changed the GUID in your GDF. Use regedit to delete any old and invalid keys from this location:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX\Games\{Whatever your GUIDs are}

I'll look into the dependency. I thought I'd got them all sorted out, but you know how it is.

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 06-04-2007 04:59 PM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Navarr
Junior Member

Registered: Aug 2007
From: Spring, TX

Can't seem to get it to work!

I just can't seem to get it to work. I know the GDF is embedded (I checked using a resource editor) and I know the GDF is properly formatted (made using the GDF maker) and it seems to be all well and good.

The only thing in the exe is the GDF file, so, I don't know if there is a way to check for errors; so I only added an ${Else} to echo out if it doesn't register; and the game just won't register.

Using this code...

code:
Games::registerGame "$INSTDIR\pokequest.exe" pop $0 ${If} $0 != "0" ${AndIf} $0 != "" MessageBox MB_OK "Game Registered!!!" CreateDirectory "$0\PlayTasks\0" CreateShortCut "$0\PlayTasks\0\Play.lnk" "$INSTDIR\pokequest.exe" CreateDirectory "$0\SupportTasks\0" CreateShortCut "$0\SupportTasks\0\Home Page.lnk" "http://pokequest.gtaero.net/" CreateDirectory "$0\SupportTasks\1" CreateShortCut "$0\SupportTasks\1\Forums.lnk" "http://pokequest.gtaero.net/forum" ${Else} MessageBox MB_OK "Game Not Registered! @.@;;" ${EndIf}


and I get back "Game Not Registered! @.@;;" every time! I checked using regedit and found that there is no data in the registry for my game.

What is the problem? Does anyone know, can anyone help me?

[pokequest [dot] gtaero [dot] net/pokequest.exe] for reference. (It literally does nothing and wont even run without cygwin1.dll, all it has is the GDF embedded)

Last edited by Navarr on 08-03-2007 at 12:11 AM

Quick Link | Report this post to a moderator | IP: Logged

Navarr is offline Old Post 08-02-2007 11:49 PM
Click Here to See the Profile for Navarr Click here to Send Navarr a Private Message Click Here to Email Navarr Find more posts by Navarr Add Navarr to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

What is the value in $0? Is it "0" (indicating that there was an error) or "" (indicating that the target machine isn't Windows Vista)?

If it's "", and your machine is Windows Vista, then there's probably a bug in the plugin.

If it's "0", then check your log messages, because it should give you a better error message there.

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 08-03-2007 01:22 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Navarr
Junior Member

Registered: Aug 2007
From: Spring, TX

quote:
Originally posted by Skrapion
What is the value in $0? Is it "0" (indicating that there was an error) or "" (indicating that the target machine isn't Windows Vista)?

If it's "", and your machine is Windows Vista, then there's probably a bug in the plugin.

If it's "0", then check your log messages, because it should give you a better error message there.



Okay; EDIT; I checked the log; and it seems that its failing to find the GDF embedded. As far as I know; the GDF is embedded, and it seems to be embedded correctly in the EXE file. I'll run a check installing the "bejewled.exe" file using NSIS to see if it does the same or if it works...

FOLLOWUP: I used the Bejeweled.exe from PopCap Games, and it gives a problem. "The following error occurred while parsing the GDF data embedded in 'C:\Program Files\pokequest\pokequest.exe'
Error document empty."

FOLLOWUP: I found a problem in the EXE, not having the resource named correctly; I fixed that problem up right quick and its giving me the same error it did with Bejeweled, That the Error Document Empty. They're set to the Neutral Language. So I believe its a problem with the plugin?

FOLLOWUP: The Same problem happens with it set to English (United States). ???

Last edited by Navarr on 08-03-2007 at 02:47 AM

Quick Link | Report this post to a moderator | IP: Logged

Navarr is offline Old Post 08-03-2007 01:59 AM
Click Here to See the Profile for Navarr Click here to Send Navarr a Private Message Click Here to Email Navarr Find more posts by Navarr Add Navarr to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

It seems the plugin doesn't like UTF-16. Convert the xml file to UTF-8 (including the <?xml?> statement) and try again.

I'll put that on my TODO list, but I'm too busy to fix it until next month.

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 08-03-2007 04:11 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
Navarr
Junior Member

Registered: Aug 2007
From: Spring, TX

quote:
Originally posted by Skrapion
It seems the plugin doesn't like UTF-16. Convert the xml file to UTF-8 (including the <?xml?> statement) and try again.

I'll put that on my TODO list, but I'm too busy to fix it until next month.



Thanks; yeah, it was because it was using UTF-16. You really need to build in some support for that for the poor chinese users :-p

Thanks a whole bunch man, you're the greatest :3

Quick Link | Report this post to a moderator | IP: Logged

Navarr is offline Old Post 08-03-2007 04:27 AM
Click Here to See the Profile for Navarr Click here to Send Navarr a Private Message Click Here to Email Navarr Find more posts by Navarr Add Navarr to your buddy list Edit/Delete Message Reply w/Quote
Skrapion
Junior Member

Registered: May 2007
From: Toronto, Canada

No problem. Let me know if you find more bugs!

Quick Link | Report this post to a moderator | IP: Logged

Skrapion is offline Old Post 08-03-2007 04:53 AM
Click Here to See the Profile for Skrapion Click here to Send Skrapion a Private Message Click Here to Email Skrapion Find more posts by Skrapion Add Skrapion to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:37 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Vista Games Explorer and Media Center
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON