[Gambas-user] Application.Version of another program

Benoît Minisini g4mba5 at gmail.com
Sat Dec 11 11:16:06 CET 2021


Le 11/12/2021 à 06:05, Admin a écrit :
>>
>> At the moment, the only standard way is using the 'gba3' program, 
>> which may not necessarily be installed.
>>
>> Sub GetApplicationVersion(sPath As String) As String
>>
>>   Dim sStartup As String
>>   Dim aStartup As String[]
>>
>>   Exec ["gba3", "-x", sPath, ".startup" ] To sStartup
>>   aStartup = Split(Trim(sStartup), "\n")
>>
>>   ' Version number is the 5th line of the '.startup' file.
>>   Return aStartup[4]
>>
>> End
>>
>> Regards,
>>
> Benoit, correct me if I am wrong, but this example works with the 
> project's sources, so if I am distributing my program as a standalone 
> .gambas file, gba3 is of no use.
> 

It works. 'gba3' is used for extracting the '.startup' interpreter 
configuration file from the '*.gambas' executable file, and then extract 
the version from it.

But 'gba3' is not necessarily installed, so this is not a perfect 
solution. It's just the only reliable one at the moment.

Regards,

-- 
Benoît Minisini


More information about the User mailing list