Page 1 of 1

GetVersion()

Posted: Sun Sep 11, 2016 7:51 pm
by mritter0
How about adding a command to get a file/program's version string?

Code: Select all

IDOS->GetVersion(Path,
    GETVERSION_FullString, &buffer,
    GETVERSION_Version, &version,
    GETVERSION_Revision, &revision,
    GETVERSION_Date, &datebuffer,
    GETVERSION_Comment, &commentbuffer,   (the extended comment at end)
TAG_DONE);

Re: GetVersion()

Posted: Mon Sep 12, 2016 12:16 am
by colinw
The best you can hope for is information that is actually stored in an executable.

Check out the autodocs for; IDOS->GetSegListInfoTags()
Specifically for the tags; GSLI_VersionString, GSLI_ResidentVersionString and GSLI_ResidentStruct.

There is also example code at the bottom.

Re: GetVersion()

Posted: Sat Sep 17, 2016 4:21 pm
by salass00
colinw wrote: Check out the autodocs for; IDOS->GetSegListInfoTags()
Specifically for the tags; GSLI_VersionString, GSLI_ResidentVersionString and GSLI_ResidentStruct.
A function to help parse the version string into its components (name, version, revision and date) might still be useful just so everyone doesn't have to roll their own functions for this.

Re: GetVersion()

Posted: Sun Sep 18, 2016 12:42 am
by mritter0
C:version path full >T:version.txt

then Parsing the text file is so old school. ;)

It should also work for devices/volumes. Colinw's suggestion doesn't work for them.

Re: GetVersion()

Posted: Sun Sep 18, 2016 7:25 am
by salass00
mritter0 wrote: It should also work for devices/volumes. Colinw's suggestion doesn't work for them.
I guess you mean file systems because the device and volume entries do not have version strings attached.

In order to get the version string of a running file system you just have to get the seglist pointer and pass it to the function that Colin mentioned. IIRC I posted some code to do this on www.amigans.net a while back.

Re: GetVersion()

Posted: Sun Sep 18, 2016 11:18 am
by colinw
mritter0 wrote: C:version path full >T:version.txt
then Parsing the text file is so old school. ;)

It should also work for devices/volumes. Colinw's suggestion doesn't work for them.
C:Version works with all filesystem "device" names.
ie: ENV: RAM: APPDIR: ....
But not currently with the "volume" names.