Game Development Community

Vista Install - Game Explorer

by Chris Mahnken · in General Discussion · 03/01/2007 (4:34 pm) · 4 replies

This isn't specifically a Torque related problem, but sooner or later everybody here is likely to be hit by this problem, if only a glancing blow.

Windows Vista has a lovely new feature called Game Explorer. In theory, all games are gathered here for easy locating, and easy control by parents. Here they can set hours for game-play, or restrictions based on ESRB ratings.

As a developer, there are just a few "easy" steps to get your game to show up in the Game Explorer. All of the tools needed (for the most part) are available from the latest DirectX SDK.

1. Get an ESRB rating.
2. Build a Game Definition File (GDF) using the GDFMaker.exe from the DX SDK.
3. Compile the resulting resources into a DLL or EXE, using the sample code found in the DX SDK.
4. Digitally sign your build.
5. Use the GameuxInstallHelper.dll to insert the game into the Game Explorer.
6. Profit.

Seams easy enough, but so far, no luck at all.

- Microsoft's tools tell me that I have a good GDF.DLL file.
- Microsoft's SignTool.exe verifies that my digital signature is valid
- My debugger tells me that GameuxInstallHelper.dll is being called correctly from my installer and is either working correctly, or totally eating any errors.
- Game Explorer tells me that no games have been added.


If anybody has any hints on how to get this bastich to work, I'd be happy to know what you've done. I'd even be happy to send beer in the mail if your state isn't one of those that will send Walker Texas Ranger to kill me for mailing liquid bread.

I've been working with both Inno Setup and NSIS (latest versions of each). Both are free.

You can get all the tools you'll need from the latest DX SDK.

1. GameuxInstallHelper.dll
2. A signed GDF.DLL from microsoft (GDFExampleBinary.dll)

And I'll reply with my NSIS install script below as a sample to start from.


Chris

About the author

Recent Threads

  • Store is McBroken

  • #1
    03/01/2007 (4:35 pm)
    ; =====================================================
    ; PROJECT: NSIS Vista Test Install
    ;
    ; NSIS script to install to Vista and test the GDF / Game Explorer code
    ; --------------------------------------------------------------------

    Name "Game Explorer Test" ; Installer Name
    OutFile "GETest.exe" ; Installer File Name
    InstallDir $PROGRAMFILES\getest ; The default installation directory

    ; =====================================================
    ; Include the following
    ; --------------------------------------------------------------------

    !include "WinVer.nsh"
    !include "LogicLib.nsh"
    !include "FileFunc.nsh"


    RequestExecutionLevel admin
    !define GIS_CURRENT_USER 2
    !define GIS_ALL_USERS 3

    !define TITLE "GETest"
    !define GDFEXE "GDFExampleBinary.dll"
    !define PROGNAME "GAME.exe"
    !define PROGARGS ""

    ;--------------------------------
    ; Pages

    Page directory
    Page instfiles

    UninstPage uninstConfirm
    UninstPage instfiles

    ;--------------------------------
    ; Install

    Section "" ;No components page, name is not important
    SetOutPath $INSTDIR

    File "GAME.exe"
    File "GDFExampleBinary.dll"
    WriteUninstaller $INSTDIR\uninstall.exe

    CreateDirectory "$SMPROGRAMS\GETest"
    CreateShortCut "$SMPROGRAMS\GETest\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
    CreateShortCut "$SMPROGRAMS\GETest\GETest (MakeNSISW).lnk" "$INSTDIR\GAME.exe" "" "$INSTDIR\GAME.exe" 0

    Call GameExplorer

    SectionEnd


    ;--------------------------------
    ; Uninstall

    Section "Uninstall"

    ; Remove files and uninstaller
    Delete $INSTDIR\GAME.exe
    Delete $INSTDIR\GameuxInstallHelper.dll
    Delete $INSTDIR\uninstall.exe

    ; Remove shortcuts, if any
    Delete "$SMPROGRAMS\GETest\*.*"

    ; Remove directories used
    RMDir "$SMPROGRAMS\GETest"

    Call un.GameExplorer

    SectionEnd


    ;-------------------------------
    ; Add to Game Explorer

    Function GameExplorer
    Pop $0 ; Save its state

    ; Check if we have Vista or later
    ClearErrors
    ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
    IfErrors finished
    StrCpy $0 $0 1
    IntCmp $0 6 0 finished

    ; Register with Game Explorer if so
    SetOutPath $Temp
    File "GameuxInstallHelper.dll"

    ; Remove first to avoid duplication
    ReadRegStr $0 HKCU "Software\TITLE" "GameExplorer"
    StrCmp $0 '' skipUninstall
    System::Call "GameuxInstallHelper::RemoveFromGameExplorer(g r0)"
    System::Call "GameuxInstallHelper::RemoveTasks(g r0)"
    skipUninstall:

    ; Now add to GE
    System::Call "GameuxInstallHelper::GenerateGUID(g .r0)"
    WriteRegStr HKCU "Software\${TITLE}" "GameExplorer" $0
    System::Call "GameuxInstallHelper::AddToGameExplorer(t '${GDFEXE}', t '$INSTDIR', i ${GIS_ALL_USERS}, g r0 r0)"
    System::Call "GameuxInstallHelper::CreateTask(i ${GIS_ALL_USERS}, g r0, i 0, i 0, t 'Play', t '$INSTDIR\${PROGNAME}', t '${PROGARGS}')"
    System::Call "GameuxInstallHelper::CreateTask(i ${GIS_ALL_USERS}, g r0, i 1, i 0, t 'Support', t 'http://www.GAMEcoGames.com/', t '')"

    finished:
    Pop $0 ; Reset its state

    FunctionEnd


    ; ---------------------------------------
    ; Remove from Game Explorer

    Function un.GameExplorer

    Push $0 ; Save its state

    ; Check if we have Vista or later
    ClearErrors
    ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
    IfErrors finished
    StrCpy $0 $0 1
    IntCmp $0 6 0 finished

    ; Remove from game explorer
    SetOutPath $Temp
    File "GameuxInstallHelper.dll"
    ReadRegStr $0 HKCU "Software\${TITLE}" "GameExplorer"
    StrCmp $0 '' finished
    System::Call "GameuxInstallHelper::RemoveFromGameExplorer(g r0)"
    System::Call "GameuxInstallHelper::RemoveTasks(g r0)"
    finished:

    Pop $0 ; Refresh its state

    FunctionEnd
    #2
    03/01/2007 (5:20 pm)
    Hey Chris, haven't seen your name in a while, getting into Torque dev eh?

    I'd recommend posting your question to the DIRECTXDEV mailing list or, I believe there is a Windows game dev mailing list. Microsoft monitors them and is usually pretty quick to respond. You may want to search the archives there, some of this has already been addressed I believe.
    #3
    03/01/2007 (5:57 pm)
    Wow, it's Chris! Hope all is well with you and best of luck with your current endevors. Sadly I have no help to offer :(
    #4
    03/01/2007 (8:12 pm)
    Hey Brian. One of my Developers has already done that. I decided to see if the Garage Games community had run into the same problem.

    Hey Zod! What are you doing these days?

    Chris