Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Calin Leafshade on Wed 16/03/2011 21:10:17

Title: Programmatically finding the version of AGS used for a game.
Post by: Calin Leafshade on Wed 16/03/2011 21:10:17
Does anyone have any idea how I might find out which version of AGS was used to make an AGS game programmatically (specifically in .NET but any platform would be useful)

Failing that does anyone know how i might determine if a game was made using the dos version of the engine?
Title: Re: Programmatically finding the version of AGS used for a game.
Post by: Clarvalon on Wed 16/03/2011 23:07:55
Game.agf has it as an attribute of AGSEditorDocument:

    <AGSEditorDocument Version="3.0.3.2" VersionIndex="4" EditorVersion="3.1.2">

The System.IO namespace should be enough to grab it, though it might be cleaner to use System.XML.  Or deserialise the whole thing if you're feeling so inclined.
Title: Re: Programmatically finding the version of AGS used for a game.
Post by: monkey0506 on Thu 17/03/2011 00:36:23
I'm pretty sure he was specifically referring to compiled games, in which case he wouldn't have access to the AGF file at all.

I do know that (at least) the latest versions of AGS have the AGS version in the file's metadata under "Product version". I'm sure that .NET has some way to read a file's metadata, though I've never specifically done it or looked into it. I don't know how long AGS has added this metadata though..
Title: Re: Programmatically finding the version of AGS used for a game.
Post by: Gilbert on Thu 17/03/2011 01:23:07
AFAIK, if you right click the game executable and click the Version tab you'll find the engine version. I think you can retrieve these information from another programme but I'm not so sure.
Title: Re: Programmatically finding the version of AGS used for a game.
Post by: Wyz on Thu 17/03/2011 02:23:35
If you want a program to find the version of an executable you should probably play around with GetFileVersionInfo (http://msdn.microsoft.com/en-us/library/ms647003(v=vs.85).aspx).