Supporting an Upgrade from Windows XP to Windows Vista

Bb173449.XDK_CHM_BANNER_left(en-us,VS.85).jpg Bb173449.XDK_CHM_BANNER_right(en-us,VS.85).jpg

Supporting an Upgrade from Windows XP to Windows Vista

Upgrading from Windows XP to Windows Vista is a scenario that your game should support. In this scenario, a user installs your game on a computer running Windows XP, and then upgrades the system to Windows Vista.

For your game to work after an upgrade to Windows Vista from Windows XP, you must create a GDF and embed it in an executable file or DLL, as you would normally need to do for a game made for Windows Vista. (For a description of creating and embedding GDFs, see Create Data Files That Game Explorer Will Consume). However, during the installation of your game, four separate tasks must be performed in to support an upgrade from Windows XP to Windows Vista. Those tasks are the following:

  • Install all of your game files.
  • Generate your own InstanceID.
  • Call SHGetFolderPath with the CLSIDs, instead of known folders IDs (because SHGetKnownFolderPath is not available in Windows XP).
  • Store values in the registry.

Generating Your Own InstanceID

In a Windows Vista installation scenario, you can simply call into the Game Explorer APIs to generate an InstanceID (a GUID) for your particular installation, but in a Windows XP installation scenario, the APIs are not available. Instead, you must generate your own InstanceID and store it in the registry or in a file. This InstanceID will be used in the next two tasks.

Installing Task Paths on Windows XP

For Windows XP, unlike the Windows Vista, you cannot use SHGetKnownFolderPath with FOLDERIDs to retrieve the task paths, as defined in Game Explorer Tasks. Instead, you must use SHGetFolderPath with CSIDLs to install your tasks.

Name Windows XP CSIDL Definition
Play task install location for all users CSIDL_COMMON_APPDATA\Microsoft\Windows\GameExplorer\{game instance ID}\PlayTasks
Play task install location for current user CSIDL_LOCAL_APPDATA\Microsoft\Windows\GameExplorer\{game instance ID}\PlayTasks
Support task install location for all users CSIDL_COMMON_APPDATA\Microsoft\Windows\GameExplorer\{game instance ID}\SupportTasks
Support task install location for current user CSIDL_LOCAL_APPDATA\Microsoft\Windows\GameExplorer\{game instance ID}\SupportTasks

Creating Custom Registry Values

You need to create a set of registry values to identify your game to the Windows Vista installation process. Your game will be added automatically to Game Explorer when the user installs Windows Vista.

First, you must determine the location of the value — this differs depending on whether your installation was for the entire system or for a single user.

Installation Scope Registry Location
Entire System HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\GameUX\GamesToFindOnWindowsUpgrade
Current User Only HKEY_CURRENT_USER\Software\Classes\Software\Microsoft\Windows\CurrentVersion\GameUX\GamesToFindOnWindowsUpgrade

In this location, you must install the subkey and values shown in the following table. Create the values in the new subkey, {game instance ID}.

Element Name Description
Subkey {game instance ID} A GUID enclosed in curly braces
String value GDFBinaryPath The fully qualified path of the binary file that contains the GDF
String value GameInstallPath The path to the game installation folder