Share via


Supporting an Upgrade from Windows XP

This section provides instructions on supporting users who have installed a game on Windows XP then upgraded to a more recent Windows version. Upgrading from Windows XP 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 a more recent version of Windows (Windows Vista or later).

For your game to work after an upgrade 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 a newer version of Windows. (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. 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 installation scenario, you can simply call into the Games 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 more recent releases of Windows, you cannot use SHGetKnownFolderPath with FOLDERIDs to retrieve the task paths, as defined in Games 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 installation process for the more recent version of Windows. Your game will be added automatically to Game Explorer when the user installs a newer version of Windows.

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