【问题标题】:Adding a game to Games Explorer将游戏添加到游戏资源管理器
【发布时间】:2011-02-03 16:57:44
【问题描述】:

我正在尝试让游戏与 Windows 游戏资源管理器集成。到目前为止,我已经在我的二进制文件中嵌入了一个游戏定义格式 XML 文件作为资源,我的实际 Inno Setup 脚本将 DLL 集成到安装程序中,如下所示:

这就是我现在设法做到的:

[Files]
Source: GameuxInstallHelper.dll;               DestDir: "{tmp}"; Flags: dontcopy
[Code]
const
 GIS_NOT_INSTALLED = 1;
  GIS_CURRENT_USER = 2;
 GIS_ALL_USERS = 3;
// Given a game instance GUID and path to GDF binary, registers game with Game Explorer 
procedure AddToGameExplorer( GDFBinPath: PChar; GameInstallPath: PChar; InstallScope : integer; GameGUID : GUID );
external 'AddToGameExplorerA@files:GameuxInstallHelper.dll stdcall';
// Given a game instance GUID, unregisters a game from Game Explorer
function RemoveFromGameExplorer( GameGUID : GUID ) : boolean;
external 'RemoveFromGameExplorer@files:GameuxInstallHelper.dll stdcall';
// Given a path to a GDF binary that has already been registered, returns a game instance GUID 
function RetrieveGUIDForApplication( GDFBinPath: PChar; var GameGUID : GUID ) : boolean; 
external 'RetrieveGUIDForApplicationA@files:GameuxInstallHelper.dll stdcall';
// Creates a unique game instance GUID
function GenerateGUID( var GameGUID : GUID ) : boolean;
external 'GenerateGUID@files:GameuxInstallHelper.dll stdcall';
// Register with Media Center using the data from a GDF binary
procedure RegisterWithMediaCenter( GDFBinPath : PChar; GameInstallPath : PChar; InstallScope : integer; ExePath : PChar; CommandLineArgs : PChar; UseRegisterMCEApp : boolean );
external 'RegisterWithMediaCenterA@files:GameuxInstallHelper.dll stdcall';
// Unregister with Media Center
procedure UnRegisterWithMediaCenter( GameInstallPath : PChar; InstallScope : integer; strExePath : PChar; UseRegisterMCEApp : boolean );
external 'UnRegisterWithMediaCenterA@files:GameuxInstallHelper.dll stdcall';
// Given a a game instance GUID, creates a task shortcut in the proper location 
procedure CreateTask( InstallScope : integer; GameInstanceGUID : GUID; SupportTask : boolean; TaskID : integer; TaskName :PChar; LaunchPath : PChar; CommandLineArgs : PChar );
external 'CreateTaskA@files:GameuxInstallHelper.dll stdcall';
// This removes all the tasks associated with a game instance GUID
// Pass in a valid GameInstance GUID that was passed to AddGame()
procedure RemoveTasks( GameInstanceGUID : GUID );
external 'RemoveTasks@files:GameuxInstallHelper.dll stdcall';
// Creates the registry keys to enable rich saved games. The game still needs to use 
// the rich saved game header as defined in the documentation and support loading a
// saved game from the command line.
procedure SetupRichSavedGames( SavedGameExtension : PChar; LaunchPath : PChar; CommandLineToLaunchSavedGame : PChar);
external 'SetupRichSavedGamesA@files:GameuxInstallHelper.dll stdcall';
// Removes the registry keys to enable rich saved games.
procedure RemoveRichSavedGames( SavedGameExtension : PChar);
external 'RemoveRichSavedGamesA@files:GameuxInstallHelper.dll stdcall';

但是,我有两个错误,我无法通过它们:

Unknown type 'GUID'

Cannot import dll:C:\Users\my user\AppData\Local\Temp\a random name folder\GameuxInstallHelper.dll

任何想法如何解决错误或修改代码?

【问题讨论】:

    标签: visual-studio inno-setup


    【解决方案1】:

    至于将 DLL 导入用户文件夹的问题 - 您是否正在检查管理权限?

    Section: PrivilegesRequired

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-25
      • 1970-01-01
      • 1970-01-01
      • 2016-04-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多